Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Time-a-function/JavaScript/time-a-function.js
Normal file
12
Task/Time-a-function/JavaScript/time-a-function.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function test() {
|
||||
let n = 0
|
||||
for(let i = 0; i < 1000000; i++){
|
||||
n += i
|
||||
}
|
||||
}
|
||||
|
||||
let start = new Date().valueOf()
|
||||
test()
|
||||
let end = new Date().valueOf()
|
||||
|
||||
console.log('test() took ' + ((end - start) / 1000) + ' seconds') // test() took 0.001 seconds
|
||||
Loading…
Add table
Add a link
Reference in a new issue