@contrail/util 1.1.3-2 → 1.1.3-3

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.
@@ -65,20 +65,18 @@ function delay(ms) {
65
65
  exports.delay = delay;
66
66
  function timed() {
67
67
  return function (target, propertyKey, descriptor) {
68
- var _a;
69
68
  const originalMethod = descriptor.value;
70
- const className = ((_a = target.constructor) === null || _a === void 0 ? void 0 : _a.name) || 'Unknown';
71
69
  descriptor.value = function (...args) {
72
70
  return __awaiter(this, void 0, void 0, function* () {
73
- const start = performance.now();
74
- console.log(`⏱️ Starting ${className}.${propertyKey}`);
71
+ const start = Date.now();
72
+ console.log(`⏱️ Starting ${propertyKey}`);
75
73
  try {
76
74
  const result = yield originalMethod.apply(this, args);
77
75
  return result;
78
76
  }
79
77
  finally {
80
- const end = performance.now();
81
- console.log(`✅ ${className}.${propertyKey} took ${(end - start).toFixed(2)}ms`);
78
+ const end = Date.now();
79
+ console.log(`✅ ${propertyKey} completed in ${end - start}ms`);
82
80
  }
83
81
  });
84
82
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/util",
3
- "version": "1.1.3-2",
3
+ "version": "1.1.3-3",
4
4
  "description": "General javascript utilities",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",