complete-common 2.30.0 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
* const elapsedSeconds = getElapsedSeconds(startTime);
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
export declare function getElapsedSeconds(startTime: number): number;
|
|
19
|
+
export declare function getElapsedSeconds(startTime: number, roundToInteger?: boolean): number;
|
|
20
20
|
//# sourceMappingURL=time.d.ts.map
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
* const elapsedSeconds = getElapsedSeconds(startTime);
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
export declare function getElapsedSeconds(startTime: number): number;
|
|
19
|
+
export declare function getElapsedSeconds(startTime: number, roundToInteger?: boolean): number;
|
|
20
20
|
//# sourceMappingURL=time.d.ts.map
|
package/dist/functions/time.d.ts
CHANGED
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
* const elapsedSeconds = getElapsedSeconds(startTime);
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
export declare function getElapsedSeconds(startTime: number): number;
|
|
19
|
+
export declare function getElapsedSeconds(startTime: number, roundToInteger?: boolean): number;
|
|
20
20
|
//# sourceMappingURL=time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/functions/time.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/functions/time.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,cAAc,UAAO,GACpB,MAAM,CAMR"}
|
package/dist/index.cjs
CHANGED
|
@@ -666,11 +666,11 @@ function truncateString(string, maxLength) {
|
|
|
666
666
|
return string.slice(0, maxLength);
|
|
667
667
|
}
|
|
668
668
|
|
|
669
|
-
function getElapsedSeconds(startTime) {
|
|
669
|
+
function getElapsedSeconds(startTime, roundToInteger = true) {
|
|
670
670
|
const endTime = Date.now();
|
|
671
671
|
const elapsedMilliseconds = endTime - startTime;
|
|
672
672
|
const elapsedSeconds = elapsedMilliseconds / 1e3;
|
|
673
|
-
return Math.floor(elapsedSeconds);
|
|
673
|
+
return roundToInteger ? Math.floor(elapsedSeconds) : elapsedSeconds;
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
function* tupleEntries(tuple) {
|
package/dist/index.mjs
CHANGED
|
@@ -664,11 +664,11 @@ function truncateString(string, maxLength) {
|
|
|
664
664
|
return string.slice(0, maxLength);
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
-
function getElapsedSeconds(startTime) {
|
|
667
|
+
function getElapsedSeconds(startTime, roundToInteger = true) {
|
|
668
668
|
const endTime = Date.now();
|
|
669
669
|
const elapsedMilliseconds = endTime - startTime;
|
|
670
670
|
const elapsedSeconds = elapsedMilliseconds / 1e3;
|
|
671
|
-
return Math.floor(elapsedSeconds);
|
|
671
|
+
return roundToInteger ? Math.floor(elapsedSeconds) : elapsedSeconds;
|
|
672
672
|
}
|
|
673
673
|
|
|
674
674
|
function* tupleEntries(tuple) {
|
package/package.json
CHANGED
package/src/functions/time.ts
CHANGED
|
@@ -17,10 +17,13 @@
|
|
|
17
17
|
* const elapsedSeconds = getElapsedSeconds(startTime);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export function getElapsedSeconds(
|
|
20
|
+
export function getElapsedSeconds(
|
|
21
|
+
startTime: number,
|
|
22
|
+
roundToInteger = true,
|
|
23
|
+
): number {
|
|
21
24
|
const endTime = Date.now();
|
|
22
25
|
const elapsedMilliseconds = endTime - startTime;
|
|
23
26
|
const elapsedSeconds = elapsedMilliseconds / 1000;
|
|
24
27
|
|
|
25
|
-
return Math.floor(elapsedSeconds);
|
|
28
|
+
return roundToInteger ? Math.floor(elapsedSeconds) : elapsedSeconds;
|
|
26
29
|
}
|