Discussion corner for Developers of Serendipity.
-
fdsa4321@A - Posts:1
- Joined:Wed Jun 22, 2022 12:20 pm
Javascript wait 1 second code
Post
by fdsa4321@A » Wed Jun 22, 2022 12:24 pm
Javascript wait 1 second function is used to pause the execution of a script for a specified amount of time. This is a simple script that will wait for a specific amount of time before executing the next statement. This can be useful when you want to synchronize things like animations and page navigation.
python wait 1 sec
Code: Select all
import time
# Wait for 5 seconds
time.sleep(5)
# Wait for 300 milliseconds
# .3 can also be used
time.sleep(.300)
javascript settimeout
Code: Select all
setTimeout(function(){
alert("Sup!");
}, 2000);//wait 2 seconds
javascript wait 1 second
Code: Select all
setTimeout(function(){
console.log("Ready")
}, 1000);