Comparing version 0.0.24 to 0.0.25
@@ -1,3 +0,4 @@ | ||
export declare function micros(): number; | ||
export declare function micros(start?: [number, number]): number; | ||
export declare function time(): [number, number]; | ||
export declare function span(start: [number, number], offset?: number): string; | ||
export declare function lapse(lapse: [number, number], offset?: number): string; |
@@ -5,4 +5,4 @@ "use strict"; | ||
const ZERO = Date.now(); | ||
function micros() { | ||
const hd = process.hrtime(LOAD); | ||
function micros(start) { | ||
const hd = process.hrtime(start || LOAD); | ||
const now = (ZERO + hd[0] * 1000) * 1000 + Math.floor(hd[1] / 1000); | ||
@@ -17,3 +17,6 @@ return now; | ||
function span(start, offset) { | ||
const lapse = process.hrtime(start); | ||
return lapse(process.hrtime(start)); | ||
} | ||
exports.span = span; | ||
function lapse(lapse, offset) { | ||
const ms = (lapse[0] * 1000) + Math.floor(lapse[1] / 1000000) - (offset || 0); | ||
@@ -23,3 +26,3 @@ const ns = Math.floor((lapse[1] % 1000000) / 1000) / 1000; | ||
} | ||
exports.span = span; | ||
exports.lapse = lapse; | ||
//# sourceMappingURL=time.js.map |
{ | ||
"name": "exer", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Utils in TypeScript, Debug, NanoTimer ...", | ||
@@ -5,0 +5,0 @@ "author": "kbajalc@gmail.com", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
179007
2426