Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Hint:“javascript sleep 1 second” is a pretty common code problem that people search ;-)

function go() {
    if (go.count < 4) {
        // logs 1, 2, 3 to firebug console at 1 second intervals
        console.log(go.count++);
        window.setTimeout(go, 1000);
    }
}
go.count = 1;

go();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sleep #pretty #common #code #problem #people #search
ADD COMMENT
Topic
Name
6+2 =