Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

date time js

//Do you need the current time ? ⌚
let date = new Date();
let time = ((date.getHours().toString()).length>1? date.getHours() : "0"+date.getHours()) +":"+ ((date.getMinutes().toString()).length>1? date.getMinutes() : "0"+date.getMinutes());
//If 4h-2min => 04:02
//If 20h-15min => 20:15
Comment

javascript time script

var start = new Date();

//do some think that takes a while here

var runTime = new Date() - start;
console.log("Script took:"+runTime+" Milliseconds to run");
Comment

js time function

const t0 = performance.now();
doSomething();
const t1 = performance.now();
console.log(`Call to doSomething took ${t1 - t0} milliseconds.`);
Comment

PREVIOUS NEXT
Code Example
Javascript ::  
::  
::  
::  
::  
::  
Javascript :: how to minimize electron app to tray icon 
:: js array from 
::  
::  
::  
::  
::  
::  
Javascript ::  
::  
::  
::  
::  
::  
Javascript ::  
::  
::  
::  
Javascript ::  
::  
::  
::  
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
5+7 =