Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Libfaketime | 2,291 | 1 | a month ago | 1 | February 27, 2018 | 17 | gpl-2.0 | C | ||
libfaketime modifies the system time for a single application | ||||||||||
Elevenclock | 1,958 | 6 days ago | 7 | gpl-3.0 | Python | |||||
ElevenClock: Customize Windows 11 taskbar clock | ||||||||||
Truetime Android | 1,316 | 19 days ago | 36 | apache-2.0 | Kotlin | |||||
Android NTP time library. Get the true current time impervious to device clock time changes | ||||||||||
Time | 1,000 | 2 years ago | 76 | C++ | ||||||
Time library for Arduino | ||||||||||
Link | 969 | 8 days ago | 18 | other | C++ | |||||
Ableton Link | ||||||||||
Fake Timers | 750 | 44,901 | 2,883 | 13 days ago | 44 | February 04, 2020 | 21 | bsd-3-clause | JavaScript | |
Fake setTimeout and friends (collectively known as "timers"). Useful in your JavaScript tests. Extracted from Sinon.JS | ||||||||||
Clock | 646 | 135 | 531 | 14 days ago | 15 | November 15, 2021 | 3 | mit | Go | |
Clock is a small library for mocking time in Go. | ||||||||||
Node Microtime | 565 | 4,077 | 664 | 10 months ago | 39 | June 09, 2022 | 1 | mit | C++ | |
Get the current time in microseconds | ||||||||||
Bemanalogclock | 488 | 11 | 6 years ago | 7 | April 28, 2016 | 2 | mit | Objective-C | ||
iOS library to create elegant, interactive clocks. | ||||||||||
React Datetime Picker | 476 | 92 | 41 | 2 days ago | 48 | September 19, 2022 | 6 | mit | TypeScript | |
A datetime picker for your React app. |
Date.now() will only give you accuracy in milliseconds. This module calls
gettimeofday(2)
to get the time in microseconds and provides it in a few
different formats. The same warning from that function applies:
The resolution of the system clock is hardware dependent, and the time may
be updated continuously or in ``ticks.''
As of version 3.0.0
, this library is built using the N-API library. This should allow you to upgrade to newer versions of Node.js without having to reinstall / rebuild this library.
Version 3.0.0
and later also bundle prebuilt binaries for common systems in
the npm package itself. These will be used if the version of Node you are using
supports N-API (>= v6.14.2), otherwise the binary will be recompiled on install.
npm install microtime
Get the current time in microseconds as an integer.
Get the current time in seconds as a floating point number with microsecond
accuracy (similar to time.time()
in Python and Time.now.to_f
in Ruby).
Get the current time and return as a list with seconds and microseconds (matching the return value of gettimeofday(2)
).
> var microtime = require('microtime')
> microtime.now()
1297448895297028
> microtime.nowDouble()
1297448897.600976
> microtime.nowStruct()
[ 1297448902, 753875 ]
Starting with version 0.1.3, there is a test script that tries to guess the clock resolution. You can run it with npm test microtime
. Example output:
microtime.now() = 1298960083489806
microtime.nowDouble() = 1298960083.511521
microtime.nowStruct() = [ 1298960083, 511587 ]
Guessing clock resolution...
Clock resolution observed: 1us