Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 70x 70x 1049x 70x 1049x 1049x 70x 70x 70x | const NS_TO_S = 1e9;
 
// seconds takes a tuple of [seconds, nanoseconds]
// and returns the time in seconds
const seconds: (diff: [number, number]) => number = (diff) =>
    diff[0] + diff[1] / NS_TO_S;
 
const newTimer: () => () => number = () => {
    const now = process.hrtime();
    return () => seconds(process.hrtime(now));
};
 
const timer = {
    seconds,
    new: newTimer,
};
 
export default timer;
 
module.exports = {
    seconds,
    new: newTimer,
};
  |