#stopwatch #default #derive-more #hifitime #stdtime

no-std ticky

A stopwatch library, written in Rust

2 stable releases

1.0.2 Apr 1, 2023
1.0.1 Jan 2, 2023
0.1.0 Dec 27, 2022

#17 in #stopwatch


Used in dokkoo

AGPL-3.0-or-later

28KB
183 lines

Ticky

Ticky is a stopwatch library, written in Rust.

LICENSE: AGPL-3.0-or-later


lib.rs:

Ticky

A simple stopwatch implementation.

Example

use ticky::Stopwatch;
let mut sw = Stopwatch::start_new();
// Do something …
sw.stop();
println!("Elapsed time: {}ms", sw.elapsed_ms_whole());

Features

  • derive_more - Enables using derive_more for deriving From, Into, Mul, MulAssign, Div, DivAssign, Rem, Shr, and Shl for Stopwatch.
  • hifitime - Enables using hifitime for high-resolution timekeeping.
  • stdtime - Enables using std::time for timekeeping.

Either hifitime or stdtime must be enabled. If neither is enabled, stdtime is used by default. If both are enabled, hifitime is used.

Installation

Run cargo add ticky to add Ticky to your Cargo.toml file.

License

Ticky is licensed under the GNU Affero General Public License.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for more information.

Authors

Acknowledgements

Dependencies

~0–1.9MB
~35K SLoC