min_timer
This is a small library that provides f64 based duration and timer. Standard
library's implementation uses integers. Thus, for a clock that gives time as
f64, this library should have higher performance.
A small statistics and profiling functionality is also provided. This are all intended to be used in a real-time application.
Additionally, there are lesschecks. Although, there is strong type safety for SI units (seconds), which is hopefully optimized away by the compiler.
Examples
Motivation
Why write this when there is the standard library?
-
Education: I got to practice Rust, espacially newtype pattern with
Sec. -
I didn't now much about
std::timebefore writing this. -
I will use this with GLFW timer, which returns the time as a
doublein seconds. This way I will implementNowwith GLFW and there will be no conversions compared to:let start = time; let elapsed = time - start; let seconds = elapsed.as_sec_f64; // conversion!Check out my other crate, min_gl, for seeing the
Nowimplementation for the GLFW timer. -
This crate provided a space where I could put more stuff about time, like profiling.
Copyright (C) 2022 Cem Geçgel gecgelcem@outlook.com