{"id":15031109,"url":"https://github.com/fast/fastant","last_synced_at":"2025-04-10T00:21:47.658Z","repository":{"id":252796256,"uuid":"841480605","full_name":"fast/fastant","owner":"fast","description":"A drop-in replacement for std::time::Instant that is faster and more accurate.","archived":false,"fork":false,"pushed_at":"2025-02-13T09:09:49.000Z","size":258,"stargazers_count":23,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-06T03:12:52.429Z","etag":null,"topics":["instant","rust","rust-lang","time"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/fastant","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fast.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":"2024-08-12T13:46:49.000Z","updated_at":"2025-03-26T13:08:54.000Z","dependencies_parsed_at":"2024-10-17T15:58:30.571Z","dependency_job_id":"93427675-4891-4d3a-a136-0b0bc8109e39","html_url":"https://github.com/fast/fastant","commit_stats":null,"previous_names":["tisonkun/fastant"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fast%2Ffastant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fast","download_url":"https://codeload.github.com/fast/fastant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248132124,"owners_count":21052978,"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":["instant","rust","rust-lang","time"],"created_at":"2024-09-24T20:14:55.030Z","updated_at":"2025-04-10T00:21:47.628Z","avatar_url":"https://github.com/fast.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastant\n\nA drop-in replacement for [`std::time::Instant`](https://doc.rust-lang.org/std/time/struct.Instant.html) that measures time with high performance and high accuracy powered by [Time Stamp Counter (TSC)](https://en.wikipedia.org/wiki/Time_Stamp_Counter).\n\n[![Actions Status](https://github.com/fast/fastant/workflows/CI/badge.svg)](https://github.com/fast/fastant/actions)\n[![Documentation](https://docs.rs/fastant/badge.svg)](https://docs.rs/fastant/)\n[![Crates.io](https://img.shields.io/crates/v/fastant.svg)](https://crates.io/crates/fastant)\n[![LICENSE](https://img.shields.io/github/license/fast/fastant.svg)](LICENSE)\n\n## Usage\n\n```toml\n[dependencies]\nfastant = \"0.1\"\n```\n\n```rust\nfn main() {\n    let start = fastant::Instant::now();\n    let duration: std::time::Duration = start.elapsed();\n}\n```\n\n## Motivation\n\nThis library is used by a high performance tracing library [`fastrace`](https://github.com/fast/fastrace). The main purpose is to use [Time Stamp Counter (TSC)](https://en.wikipedia.org/wiki/Time_Stamp_Counter) on x86 processors to measure time at high speed without losing much accuracy.\n\n## Platform Support\n\nCurrently, only the Linux on `x86` or `x86_64` is backed by Time Stamp Counter (TSC). On other platforms, Fastant falls back to `std::time`. If TSC is unstable, it will also fall back to `std::time`.\n\nIf speed is privileged over accuracy when fallback occurs, you can use `fallback-coarse` feature to use coarse time:\n\n```toml\n[dependencies]\nfastant = { version = \"0.1\", features = [\"fallback-coarse\"] }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffast%2Ffastant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffast%2Ffastant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffast%2Ffastant/lists"}