“Ustaw interwał” Kod odpowiedzi

JavaScript setInterval

setInterval(function(){ 
	console.log("Oooo Yeaaa!");
}, 2000);//run this thang every 2 seconds
Grepper

Timeout JavaScript

setTimeout(function(){
 	//code goes here
}, 2000); //Time before execution
Phil the ice cream man

JS Settimeout

setTimeout(() => { alert('Hello') }, 1000)
Hotentot

Timer w JavaScript

//single event i.e. alarm, time in milliseconds
var timeout = setTimeout(function(){yourFunction()},10000);
//repeated events, gap in milliseconds
var interval = setInterval(function(){yourFunction()},1000);
Dr. Hippo

set_interval ()

import threading

def set_interval(func, sec):
    def func_wrapper():
        set_interval(func, sec)
        func()
    t = threading.Timer(sec, func_wrapper)
    t.start()
    return t
Homeless Hawk

Ustaw interwał

this.interval = setInterval(() => {
    this.currentTime = this.currentTime + 10;
    console.log(this.currentTime);
}, 1000);
Delightful Deer

Odpowiedzi podobne do “Ustaw interwał”

Pytania podobne do “Ustaw interwał”

Więcej pokrewnych odpowiedzi na “Ustaw interwał” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu