Can you delay the printing of text to the console?


#1

`
hi i would like to know wether or not you can delay the printing of one section of text, by one second before the other one prints. i have got the code if you need to see it but it works well.

`


#2

Javascript has a few delay methods but I don't know if they will perform the task to what you are trying to achieve,

two of them are,

setTimeout(function, milliseconds) //one second would 1000

setInterval(function, milliseconds);

#3

what would it look like on this:
var minecraft = true
var myLoop = 0

while (minecraft) {
console.log("bridges will fall in 60 seconds")
console.log("59")
console.log("58")
console.log("57")
console.log("56")
console.log("55")
console.log("54")
console.log("53")
console.log("52")
console.log("51")
console.log("50")
console.log("49")
console.log("48")
console.log("47")
console.log("46")
console.log("45")
console.log("44")
console.log("43")
console.log("42")
console.log("41")
console.log("40")
console.log("39")
console.log("38")
console.log("37")
console.log("36")
console.log("35")
console.log("34")
console.log("33")
console.log("32")
console.log("31")
console.log("30")
console.log("29")
console.log("28")
console.log("27")
console.log("26")
console.log("25")
console.log("24")
console.log("23")
console.log("22")
console.log("21")
console.log("20")
console.log("19")
console.log("18")
console.log("17")
console.log("16")
console.log("15")
console.log("14")
console.log("13")
console.log("12")
console.log("11")
console.log("10")
console.log("9")
console.log("8")
console.log("7")
console.log("6")
console.log("5")
console.log("4")
console.log("3")
console.log("2")
console.log("1")
console.log("0")
var minecraft = false
for (var i = 0; i < 1; i++) {
console.log("the bridges are falling");
}
}
i just was wondering what to do for my for and while lesson,when i had the idea, but it doesn't delay by one second, which is what i would like it to do


#4

i'm not sure what i need to do next


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.