//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
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");
const t0 = performance.now();
doSomething();
const t1 = performance.now();
console.log(`Call to doSomething took ${t1 - t0} milliseconds.`);
Code Example |
---|
Javascript :: |
:: |
:: |
:: |
:: |
:: |
Javascript :: how to minimize electron app to tray icon |
:: js array from |
:: |
:: |
:: |
:: |
:: |
:: |
Javascript :: |
:: |
:: |
:: |
:: |
:: |
Javascript :: |
:: |
:: |
:: |
Javascript :: |
:: |
:: |
:: |
:: |
:: |