forked from enviPath/enviPy
Current Dev State
This commit is contained in:
11
static/js/ketcher2/node_modules/redux-logger/src/helpers.js
generated
vendored
Normal file
11
static/js/ketcher2/node_modules/redux-logger/src/helpers.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export const repeat = (str, times) => (new Array(times + 1)).join(str);
|
||||
|
||||
export const pad = (num, maxLength) => repeat('0', maxLength - num.toString().length) + num;
|
||||
|
||||
export const formatTime = time => `${pad(time.getHours(), 2)}:${pad(time.getMinutes(), 2)}:${pad(time.getSeconds(), 2)}.${pad(time.getMilliseconds(), 3)}`;
|
||||
|
||||
// Use performance API if it's available in order to get better precision
|
||||
export const timer =
|
||||
(typeof performance !== 'undefined' && performance !== null) && typeof performance.now === 'function' ?
|
||||
performance :
|
||||
Date;
|
||||
Reference in New Issue
Block a user