+5
-3
| { | ||
| "name": "perfpro", | ||
| "version": "0.1.0", | ||
| "description": "Node.js performance profiler and logger", | ||
| "version": "0.2.0", | ||
| "description": "Node.js performance profiler", | ||
| "type": "module", | ||
@@ -17,3 +17,5 @@ "main": "./perfpro.js", | ||
| "profiling", | ||
| "logging" | ||
| "record", | ||
| "time", | ||
| "duration" | ||
| ], | ||
@@ -20,0 +22,0 @@ "engines": { |
+9
-0
@@ -47,2 +47,11 @@ /** Performance metrics class */ | ||
| /** | ||
| * Returns time since application started | ||
| * @returns {number} | ||
| */ | ||
| now() { | ||
| return performance.now(); | ||
| } | ||
| /** | ||
| * Record a performance mark | ||
@@ -49,0 +58,0 @@ * Call twice with same name to set start and end |
+9
-1
@@ -1,2 +0,2 @@ | ||
| # PerfPro: Node.js performance profiler and logger | ||
| # PerfPro: Node.js performance profiler | ||
@@ -43,2 +43,5 @@ PerfPro is a wrapper for the high-resolution [Node.js Performance measurement API](https://nodejs.org/docs/latest/api/perf_hooks.html). | ||
| perf.clear(); | ||
| // show time since application started | ||
| console.log( perf.now() ); | ||
| ``` | ||
@@ -80,1 +83,6 @@ | ||
| * `name` (string, optional): mark name. Pass nothing to to clear all marks for the app. | ||
| ### `now()` | ||
| Returns time since application started. |
6298
4.17%90
8.43%87
10.13%