{"id":23655228,"url":"https://github.com/caplin/nanotime","last_synced_at":"2025-07-13T09:37:03.960Z","repository":{"id":54137791,"uuid":"104476540","full_name":"caplin/nanotime","owner":"caplin","description":"JNI library for nanosecond accuracy timestamps in Java 8","archived":false,"fork":false,"pushed_at":"2022-05-20T03:43:25.000Z","size":185,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":23,"default_branch":"develop","last_synced_at":"2025-06-06T09:51:22.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/caplin.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}},"created_at":"2017-09-22T13:18:42.000Z","updated_at":"2024-07-21T10:23:52.000Z","dependencies_parsed_at":"2022-08-13T07:20:38.385Z","dependency_job_id":null,"html_url":"https://github.com/caplin/nanotime","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/caplin/nanotime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fnanotime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fnanotime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fnanotime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fnanotime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caplin","download_url":"https://codeload.github.com/caplin/nanotime/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caplin%2Fnanotime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265121386,"owners_count":23714501,"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-12-28T19:51:59.211Z","updated_at":"2025-07-13T09:37:03.909Z","avatar_url":"https://github.com/caplin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caplin nanotime library\nJNI library for nanosecond precision timestamps in Java 8.\n\n## Timestamp Accuracy\nThe accuracy of timestamps can only be as accurate as the timestamps supplied by the operating system.\n\n## Supported Platforms\nNanosecond precision timestamps are supported by the following operating systems:\n* Red Hat Enterprise Linux 6\n* Red Hat Enterprise Linux 7\n* Windows 7\n* Windows 10\n* Apple macOS 10.12 (Sierra) and higher\n* ARM platforms\n\n## Building the project\nTo build the project, run:\n```\n./gradlew clean build\n```\nThis will build the C distributable for your platform, and package it up in the jar.\n\nTo amalgamate distributables for all supported platforms (Linux, Windows, Arm and Mac), run:\n```\nbuildAllPlatformsJar\n```\nNote that this will only work within the Caplin domain.\n\n## Publishing\nThis is a two stage build process. Note that publishing and downloading the platform specific distributables is only available within the Caplin domain.\n\nThe first stage is to build the distributable for each supported platform, and publish them to the Caplin artifactory:\n```\n./gradlew clean publishDistributablePublicationToMavenRepository\n```\n\nThe second stage is to amalgamate the distributables within a jar, and publish the jar:\n```\n./gradlew clean publishAllPlatformsJarPublicationToMavenRepository\n```\n\n## Usage\n```\nClock clock = new NanoClock();\nInstant now = clock.instant();\n```\n\n## Benchmarks\nBenchmarks can be run using:\n```\n./gradlew clean jmh\n```\n\nThese are the benchmark results for `NanoClock.instant()` compared to `System.currentTimeMillis()` and `SystemClock.instant()`. Benchmarks were conducted on `Centos 7 64-bit`.\n```\nBenchmark                                       Method                      Mode  Cnt   Score   Error  Units\nNanoClockBenchmark.measureGetNanoClockTime      NanoClock.instant()         avgt  200  37.287 ± 0.833  ns/op\nNanoClockBenchmark.measureGetSystemClockTime    SystemClock.instant()       avgt  200  39.589 ± 0.927  ns/op\nNanoClockBenchmark.measureGetSystemCurrentTime  System.currentTimeMillis()  avgt  200  30.546 ± 0.430  ns/op\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaplin%2Fnanotime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaplin%2Fnanotime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaplin%2Fnanotime/lists"}