Gathering detailed insights and metrics for microtime
Gathering detailed insights and metrics for microtime
Gathering detailed insights and metrics for microtime
Gathering detailed insights and metrics for microtime
relative-microtime
Get the number of microseconds elapsed since January 1, 1970 00:00:00 UTC without fear of clock drift
@types/microtime
TypeScript definitions for microtime
microtime-x
Get current time in microseconds (cross-environment)
microtime-nodejs
Native Javascript shim for the microtime (https://github.com/wadey/node-microtime) package
npm install microtime
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.6
Supply Chain
79.7
Quality
76
Maintenance
100
Vulnerability
100
License
C++ (60.55%)
Python (22.77%)
JavaScript (16.68%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
603 Stars
193 Commits
45 Forks
12 Watchers
24 Branches
8 Contributors
Updated on Jun 25, 2025
Latest Version
3.1.1
Package Id
microtime@3.1.1
Unpacked Size
2.62 MB
Size
827.61 kB
File Count
19
NPM Version
8.12.1
Node Version
14.19.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
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
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 2/9 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More