@@ -17,14 +17,14 @@ while (Date.now() - now < RUN_FOR_MS);
|
17 | 17 | // Get a diff reading from when we started. |
18 | 18 | const diff = process.cpuUsage(start); |
19 | 19 | |
20 | | -const MICROSECONDS_PER_SECOND = 1000 * 1000; |
| 20 | +const MICROSECONDS_PER_MILLISECOND = 1000; |
21 | 21 | |
22 | 22 | // Diff usages should be >= 0, <= ~RUN_FOR_MS millis. |
23 | 23 | // Let's be generous with the slop factor, defined above, in case other things |
24 | 24 | // are happening on this CPU. The <= check may be invalid if the node process |
25 | 25 | // is making use of multiple CPUs, in which case, just remove it. |
26 | 26 | assert(diff.user >= 0); |
27 | | -assert(diff.user <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_SECOND); |
| 27 | +assert(diff.user <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND); |
28 | 28 | |
29 | 29 | assert(diff.system >= 0); |
30 | | -assert(diff.system <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_SECOND); |
| 30 | +assert(diff.system <= SLOP_FACTOR * RUN_FOR_MS * MICROSECONDS_PER_MILLISECOND); |