https://github.com/theroyalwhee0/hrdate
High Resolution Date Time for Node
https://github.com/theroyalwhee0/hrdate
date nanosecond
Last synced: about 2 months ago
JSON representation
High Resolution Date Time for Node
- Host: GitHub
- URL: https://github.com/theroyalwhee0/hrdate
- Owner: theroyalwhee0
- License: apache-2.0
- Created: 2017-02-04T23:22:40.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T01:15:32.000Z (almost 2 years ago)
- Last Synced: 2025-03-21T05:33:48.652Z (2 months ago)
- Topics: date, nanosecond
- Language: JavaScript
- Homepage:
- Size: 146 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# hrDate: @theroyalwhee/hrdate
High Resolution Date Time for NodeJS.No significant attempts were made to profile or measure accuracy this code. It's main purpose is to get unique timestamps.
## Browser Support
hrDate does not support browsers as it depends on `process.hrtime`. It would not hard to add browser support, but `performance.now()` is limited because of [mitigations against Spectre](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now).## Example
```
const { hrDate } = require('@theroyalwhee0/hrdate');
const [second, nanosecond] = hrDate();
console.log(`${second}.${nanosecond}`);
```## Links
- GitHub: https://github.com/theroyalwhee0/hrdate
- NPM: https://www.npmjs.com/package/@theroyalwhee0/hrdate
- Changelog: https://github.com/theroyalwhee0/hrdate/blob/main/changelog.md## Legal & License
Copyright 2017-2023 Adam MillThis library is released under Apache 2 license. See [LICENSE](https://github.com/theroyalwhee0/hrdate/blob/master/LICENSE) for more details.