···11# @atcute/time-ms
2233-high precision system time, returns in microseconds (messed up the package name!)
33+high-precision absolute system time in microseconds (messed up the package name!)
4455```sh
66npm install @atcute/time-ms
77```
8899+JavaScript doesn't provide a built-in way to get the current wall-clock time with microsecond
1010+precision. `Date.now()` only goes to milliseconds, and the high-resolution alternatives
1111+(`performance.now()`, `process.hrtime()`) are monotonic clocks — great for measuring durations, but
1212+they don't tell you the actual time.
1313+1414+this package calls the platform's real-time clock directly via native bindings or FFI
1515+(`clock_gettime(CLOCK_REALTIME)` on Unix, `GetSystemTimePreciseAsFileTime` on Windows) to return the
1616+current time as microseconds since the Unix epoch. falls back to `Date.now() * 1000` when native
1717+access is unavailable.
1818+919## usage
10201121```ts
1212-import { now } from '@atcute/time-ms';
2222+import { now, hasNative } from '@atcute/time-ms';
13231424const timestamp = now();
1525// ^ 1766739339478426
1626// returns microseconds since unix epoch
2727+2828+hasNative; // whether the native module is available for the current runtime
1729```