@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.
@@ -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
+ ;
@@ -9,9 +9,6 @@
9
9
  * @returns
10
10
  */
11
11
  export default function startChrono(name) {
12
- if (!name) {
13
- name = bbn.fn.randomString(20);
14
- }
15
12
  var now = bbn.fn.microtimestamp();
16
13
  if (!this.constructor.chronos) {
17
14
  Object.defineProperty(this.constructor, 'chronos', {
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.421",
3
+ "version": "1.0.422",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",