setInterval()
When a function
is called for a specified period of time:
setInterval(function,time,lang)
function: function to be called or code string to be executed
time: required parameters, every how long to call the function, in milliseconds
lang: optional parameters, running JScript | VBScript | JavaScript
clearInterval()
Means to stop the setInterval timer call function
function getTime() {
console.log(123);
if (true) {
clearInterval(db)
}
}
let db = setInterval(getTime, 1000)
setTimeout()
Call a function after a certain time
syntax:
setTimeout(function,time,lang)
Function:
function: required, to be called
time: required, number of milliseconds to wait before executing code
lang: optional, script language: JScript | VBScript | JavaScript
Read More:
- Solution of off grid pin in Ad
- ERROR in static/js/app.xxxxxxx.js from UglifyJs Unexpected token: operator (>)
- How to turn off merge request in gitlab
- MP-BIOS bug: 8254 timer not connected to IO-APIC
- Error in compiling pcl1.9.1: “class vtkdatasetmapper” has no member named “immediatemode rendering off”
- Delete the specified crontab timer task under Linux
- Golang timer function executes a function every few minutes
- Solve the error “unable to perform operation, unexpected error (0x65b)” when inputting powercfg / h off in CMD
- Off line data storage and upload scheme
- Swap off failed: cannot allocate memory
- Register global time filter in main.js in Vue
- Turn on / off Ubuntu 20.04 graphical interface
- Linux turn off enable firewall command
- Solutions to Excel 2007 “cannot shift object off sheet”
- Cannot find module ‘.. / lib / utils / unsupported. JS’ problem in installing node in centos7
- The garbage plug-in mixed in chrome causes an error in the front-end JS operation: only one instance of Babel Polyfill is allowed
- ERROR in ./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/css/spec
- Encapsulation of Ajax JSON / fromdata request in native JS
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- Unexpected token appears in JS