Skip to content

Commit

Permalink
Use precise-now
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Aug 25, 2019
1 parent 45e6cae commit b2db5ea
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 81 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"p-map-series": "^2.1.0",
"p-timeout": "^3.1.0",
"path-exists": "^4.0.0",
"precise-now": "^0.1.1",
"read-pkg-up": "^6.0.0",
"semver": "^6.3.0",
"signal-exit": "^3.0.2",
Expand Down
72 changes: 0 additions & 72 deletions src/now.js

This file was deleted.

3 changes: 2 additions & 1 deletion src/processes/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { now } from '../now.js'
import now from 'precise-now'

import { getStats } from '../stats/compute.js'

import { runChildren } from './run.js'
Expand Down
2 changes: 1 addition & 1 deletion src/processes/run.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { now } from '../now.js'
import now from 'precise-now'

import { executeChild } from './execute.js'

Expand Down
2 changes: 1 addition & 1 deletion src/progress/update.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { now } from '../now.js'
import now from 'precise-now'

import { getTimeLeft } from './time.js'

Expand Down
2 changes: 1 addition & 1 deletion src/resolution.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { now } from './now.js'
import now from 'precise-now'

// Retrieve system's time resolution in nanoseconds.
// If the resolution is <1ns, returns 1ns.
Expand Down
3 changes: 2 additions & 1 deletion src/run/runners/cli/benchmark/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { now } from '../../../../now.js'
import now from 'precise-now'

import { sortNumbers } from '../../../../utils/sort.js'

import { measure } from './measure.js'
Expand Down
3 changes: 2 additions & 1 deletion src/run/runners/cli/benchmark/measure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { now } from '../../../../now.js'
import now from 'precise-now'

import { spawnOutput, spawnNoOutput } from '../spawn.js'

// Main measuring code.
Expand Down
2 changes: 1 addition & 1 deletion src/run/runners/node/benchmark/duration.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { now } from '../../../../now.js'
import now from 'precise-now'

// We separate async and sync measurements because following a promise (`await`)
// takes several microseconds, which does not work when measuring fast
Expand Down
2 changes: 1 addition & 1 deletion src/run/runners/node/benchmark/loop.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { now } from '../../../../now.js'
import now from 'precise-now'

import { measure } from './measure.js'
import { getRepeat } from './repeat.js'
Expand Down
2 changes: 1 addition & 1 deletion src/run/runners/node/benchmark/measure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { now } from '../../../../now.js'
import now from 'precise-now'

import { getDuration } from './duration.js'

Expand Down

0 comments on commit b2db5ea

Please sign in to comment.