#clock #time

clocksource

clocksource provides TSC access with transparent fallback to clock_gettime()

9 unstable releases (3 breaking)

0.4.0 Mar 18, 2018
0.3.0 Mar 18, 2018
0.2.4 Mar 9, 2018
0.2.3 Nov 18, 2017
0.1.0 Aug 27, 2016

#6 in Audio

Download history 141/week @ 2018-05-27 225/week @ 2018-06-03 126/week @ 2018-06-10 153/week @ 2018-06-17 123/week @ 2018-06-24 289/week @ 2018-07-01 210/week @ 2018-07-08 130/week @ 2018-07-15 158/week @ 2018-07-22 203/week @ 2018-07-29 188/week @ 2018-08-05 186/week @ 2018-08-12 112/week @ 2018-08-19

606 downloads per month
Used in 3 crates (1 directly)

MIT/Apache

13KB
238 lines

clocksource - high performance clocks for Rust

Clocksource allows access to alternate clocksources like the TSC on your Intel x86 CPU. Most modern processors support 'constant_tsc' allowing us to use this counter as a high resolution clock. The cost of reading this counter can be much lower than calls to 'clock_gettime()' - especially on virtualized environments.

Unfortunately, this requires we use nightly rust until the asm!() macro is stabilized. We provide fallback for users on stable rust, this should allow zero-cost abstraction of clock_gettime() for stable builds without benefit of the high-performance timing.

conduct-badge travis-badge downloads-badge release-badge license-badge

Code of Conduct

NOTE: All conversations and contributions to this project shall adhere to the Code of Conduct

Getting clocksource

add clocksource to your dependencies and start using it

The API documentation of this library can be found at docs.rs/clocksource.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~723KB