{"id":16305220,"url":"https://github.com/moznion/lua-hires-time","last_synced_at":"2025-10-20T00:37:59.016Z","repository":{"id":145078042,"uuid":"150835843","full_name":"moznion/lua-hires-time","owner":"moznion","description":"A library to measure the system time with high resolution for lua","archived":false,"fork":false,"pushed_at":"2018-10-11T03:11:03.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-24T05:11:48.676Z","etag":null,"topics":["lua"],"latest_commit_sha":null,"homepage":"https://luarocks.org/modules/moznion/hires-time","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-09-29T07:09:06.000Z","updated_at":"2024-01-29T09:28:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"942298fb-4460-462b-a208-1d7b9f036560","html_url":"https://github.com/moznion/lua-hires-time","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"79f142146c43e3a70672510e75d93da16f6b4c75"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Flua-hires-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Flua-hires-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Flua-hires-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Flua-hires-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/lua-hires-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239065734,"owners_count":19575774,"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":["lua"],"created_at":"2024-10-10T21:06:03.588Z","updated_at":"2025-10-20T00:37:58.950Z","avatar_url":"https://github.com/moznion.png","language":"C","readme":"lua-hires-time\n==\n\nA library to measure the system time with high resolution for lua.\n\nSynopsis\n--\n\n```lua\nlocal hires_time = require 'hires_time'\n\nlocal epoch_micros, err = hires_time.get_epoch_micros()\nif err ~= nil then\n    -- error handling...\nend\n```\n\nSee also [example](/example/).\n\nDescription\n--\n\nThis package provides a method to measure (and dispense) the system time with high resolution.\n\nLua runtime's `os.time()` returns the epoch __second__ of the system, however, there is no way to get more high accuracy one. So this library measures and returns the system time as __microseconds__.\n\nThe library bridges to `gettimeofday()` function of `sys/time.h`.\n\nFunctions\n--\n\n### `get_epoch_micros()`\n\nThis function measures and returns the system epoch time as __microseconds__.\n\n#### Return value\n\nThis method returns the values that accords the following order:\n\n- `epoch_micros` (number or nil): The system epoch time. This variable represents __microseconds__.\n- `err` (string or nil): Error response\n\nWhen `err` is nil, `epoch_micros` has an actual number value. On the other hand, when `err` is not nil, `epoch_micros` is nil.\n\nSee also\n--\n\n- http://man7.org/linux/man-pages/man2/gettimeofday.2.html\n\nLicense\n--\n\n```\nThe MIT License (MIT)\nCopyright © 2018 moznion, http://moznion.net/ \u003cmoznion@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Flua-hires-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Flua-hires-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Flua-hires-time/lists"}