Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Javascript measure function run time

/* record the current time (the current time
being the time since the current tab was
loaded in milliseconds) */
const start = performance.now();

// run your function here

/* record the current time after your
function has run */
const end = performance.now();

/* to get the time ellapsed, you simply
subtract the start time from the end time */
const ellapsed = end - start;

/* you could convert this into seconds by
dividing by 1000 */
const secondsEllapsed = ellapsed / 1000;
Comment

PREVIOUS NEXT
Code Example
Javascript :: mongodb check for array not empty query 
Javascript :: how to makewebapge editable 
Javascript :: easiest way to show current date in react 
Javascript :: bcrypt_lib.node not found 
Javascript :: jquery select checked radio button value 
Javascript :: dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.66.dylib Referenced from: /usr/local/bin/node Reason: image not found 
Javascript :: angular validators number only in reactive form 
Javascript :: js query string from object 
Javascript :: javascript set left margin 
Javascript :: select2 placeholder 
Javascript :: google colab disconnect 
Javascript :: js loop every second 
Javascript :: jquery remove and add class 
Javascript :: google dinosaur game 
Javascript :: remove localstorage 
Javascript :: swiper js cdn 
Javascript :: mongoose nestjs installation 
Javascript :: ERROR in ./server/server.js Module build failed (from ./node_modules/babel-loader/lib/index.js): 
Javascript :: first letter capital in jquery 
Javascript :: return json with jango 
Javascript :: how to store objects in localstorage 
Javascript :: javascript count words in string 
Javascript :: javascript get number of elements in object 
Javascript :: how to fetch the selected value of dropdown jquery 
Javascript :: js scroll to top 
Javascript :: jquery disable class attribute 
Javascript :: javascript get previous element sibling 
Javascript :: react empty space 
Javascript :: from milliseconds to hours in js 
Javascript :: javascript check format uuid 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =