{"id":13446500,"url":"https://github.com/wadey/node-microtime","last_synced_at":"2025-05-15T06:06:02.838Z","repository":{"id":41095013,"uuid":"1356098","full_name":"wadey/node-microtime","owner":"wadey","description":"Get the current time in microseconds","archived":false,"fork":false,"pushed_at":"2024-01-08T18:50:32.000Z","size":150,"stargazers_count":602,"open_issues_count":9,"forks_count":45,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-14T10:42:30.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wadey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-02-11T18:24:42.000Z","updated_at":"2025-03-22T10:31:03.000Z","dependencies_parsed_at":"2022-07-16T05:30:45.472Z","dependency_job_id":"fad29814-2aa6-47df-b4a5-d8eb29f85731","html_url":"https://github.com/wadey/node-microtime","commit_stats":{"total_commits":175,"total_committers":9,"mean_commits":"19.444444444444443","dds":0.08571428571428574,"last_synced_commit":"c6ce571579d5c3da2b346e53e91722e5763bfebc"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadey%2Fnode-microtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadey%2Fnode-microtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadey%2Fnode-microtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadey%2Fnode-microtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wadey","download_url":"https://codeload.github.com/wadey/node-microtime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264691,"owners_count":22041783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T05:00:53.869Z","updated_at":"2025-05-15T06:05:57.828Z","avatar_url":"https://github.com/wadey.png","language":"C++","readme":"# node-microtime\n\n[![npm](https://img.shields.io/npm/dm/microtime.svg)](https://www.npmjs.com/package/microtime)\n[![npm](https://img.shields.io/npm/v/microtime.svg)](https://www.npmjs.com/package/microtime)\n\nDate.now() will only give you accuracy in milliseconds. This module calls\n`gettimeofday(2)` to get the time in microseconds and provides it in a few\ndifferent formats. The same warning from that function applies:\n_The resolution of the system clock is hardware dependent, and the time may\nbe updated continuously or in ``ticks.''_\n\n## N-API Support\n\nAs of version `3.0.0`, this library is built using the [N-API](https://nodejs.org/api/n-api.html) library. This should allow you to upgrade to newer versions of Node.js without having to reinstall / rebuild this library.\n\nVersion `3.0.0` and later also bundle prebuilt binaries for common systems in\nthe npm package itself. These will be used if the version of Node you are using\nsupports N-API ([\u003e= v6.14.2](https://nodejs.org/api/n-api.html#n_api_n_api_version_matrix)), otherwise the binary will be recompiled on install.\n\n# Installation\n\n    npm install microtime\n\n# Usage\n\n### microtime.now()\n\nGet the current time in microseconds as an integer.\n\n### microtime.nowDouble()\n\nGet the current time in seconds as a floating point number with microsecond\naccuracy (similar to `time.time()` in Python and `Time.now.to_f` in Ruby).\n\n### microtime.nowStruct()\n\nGet the current time and return as a list with seconds and microseconds (matching the return value of `gettimeofday(2)`).\n\n# Example\n\n    \u003e var microtime = require('microtime')\n    \u003e microtime.now()\n    1297448895297028\n    \u003e microtime.nowDouble()\n    1297448897.600976\n    \u003e microtime.nowStruct()\n    [ 1297448902, 753875 ]\n\n## Estimating clock resolution\n\nStarting 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:\n\n    microtime.now() = 1298960083489806\n    microtime.nowDouble() = 1298960083.511521\n    microtime.nowStruct() = [ 1298960083, 511587 ]\n\n    Guessing clock resolution...\n    Clock resolution observed: 1us\n","funding_links":[],"categories":["C++","Repository"],"sub_categories":["Date \u0026 Time"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadey%2Fnode-microtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwadey%2Fnode-microtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadey%2Fnode-microtime/lists"}