Will
Will

Reputation: 7027

Can Node's Date.now() precision be reduced or tuned?

Can Node's Date.now() precision be reduced or tuned -- to a specific value, or to some predetermined value, like round to the nearest 10ms? For example, something similar to Firefox's privacy.reduceTimerPrecision, privacy.resistFingerprinting, privacy.resistFingerprinting.reduceTimerPrecision.microseconds?

Upvotes: 2

Views: 924

Answers (1)

Alan Fitzpatrick
Alan Fitzpatrick

Reputation: 181

You will need to use the Date methods to do this

e.g.

const nowToNearestMinute = new Date().setMinutes(0, 0, 0);

Upvotes: 2

Related Questions