@bbn/bbn 1.0.421 → 1.0.422
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.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/fn/datetime/getChrono.d.ts +12 -0
- package/dist/fn/datetime/getChrono.js +17 -0
- package/dist/fn/datetime/startChrono.js +0 -3
- package/dist/fn.d.ts +2 -0
- package/dist/fn.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Starts a timer and gives it a name.
|
|
3
|
+
* @method getChrono
|
|
4
|
+
* @global
|
|
5
|
+
* ``` javascript
|
|
6
|
+
* bbn.fn.getChrono('myChrono');
|
|
7
|
+
* ```
|
|
8
|
+
* @memberof bbn.fn
|
|
9
|
+
*
|
|
10
|
+
* @returns {Number} The elapsed time in milliseconds since the timer was started
|
|
11
|
+
*/
|
|
12
|
+
export default function getChrono(name?: string): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Starts a timer and gives it a name.
|
|
3
|
+
* @method getChrono
|
|
4
|
+
* @global
|
|
5
|
+
* ``` javascript
|
|
6
|
+
* bbn.fn.getChrono('myChrono');
|
|
7
|
+
* ```
|
|
8
|
+
* @memberof bbn.fn
|
|
9
|
+
*
|
|
10
|
+
* @returns {Number} The elapsed time in milliseconds since the timer was started
|
|
11
|
+
*/
|
|
12
|
+
export default function getChrono(name) {
|
|
13
|
+
if (name === void 0) { name = 'default'; }
|
|
14
|
+
var now = bbn.fn.microtimestamp();
|
|
15
|
+
return now - this.constructor.chronos[name];
|
|
16
|
+
}
|
|
17
|
+
;
|
package/dist/fn.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ import getAncestors from './fn/html/getAncestors.js';
|
|
|
94
94
|
import getAttributes from './fn/html/getAttributes.js';
|
|
95
95
|
import getBrowserName from './fn/browser/getBrowserName.js';
|
|
96
96
|
import getBrowserVersion from './fn/browser/getBrowserVersion.js';
|
|
97
|
+
import getChrono from './fn/datetime/getChrono.js';
|
|
97
98
|
import getCookie from './fn/browser/getCookie.js';
|
|
98
99
|
import getCssVar from './fn/style/getCssVar.js';
|
|
99
100
|
import getDay from './fn/datetime/getDay.js';
|
|
@@ -338,6 +339,7 @@ declare const _default: {
|
|
|
338
339
|
getAttributes: typeof getAttributes;
|
|
339
340
|
getBrowserName: typeof getBrowserName;
|
|
340
341
|
getBrowserVersion: typeof getBrowserVersion;
|
|
342
|
+
getChrono: typeof getChrono;
|
|
341
343
|
getCookie: typeof getCookie;
|
|
342
344
|
getCssVar: typeof getCssVar;
|
|
343
345
|
getDay: typeof getDay;
|
package/dist/fn.js
CHANGED
|
@@ -94,6 +94,7 @@ import getAncestors from './fn/html/getAncestors.js';
|
|
|
94
94
|
import getAttributes from './fn/html/getAttributes.js';
|
|
95
95
|
import getBrowserName from './fn/browser/getBrowserName.js';
|
|
96
96
|
import getBrowserVersion from './fn/browser/getBrowserVersion.js';
|
|
97
|
+
import getChrono from './fn/datetime/getChrono.js';
|
|
97
98
|
import getCookie from './fn/browser/getCookie.js';
|
|
98
99
|
import getCssVar from './fn/style/getCssVar.js';
|
|
99
100
|
import getDay from './fn/datetime/getDay.js';
|
|
@@ -338,6 +339,7 @@ export default {
|
|
|
338
339
|
getAttributes: getAttributes,
|
|
339
340
|
getBrowserName: getBrowserName,
|
|
340
341
|
getBrowserVersion: getBrowserVersion,
|
|
342
|
+
getChrono: getChrono,
|
|
341
343
|
getCookie: getCookie,
|
|
342
344
|
getCssVar: getCssVar,
|
|
343
345
|
getDay: getDay,
|