A minimal C++ timer class for microsecond-precision cross-platform benchmarking with minimal overhead.
plf::nanotimer is a simple C++ timer class designed for high-precision cross-platform benchmarking. It provides microsecond-level timing measurements with minimal implementation overhead, making it suitable for performance analysis where accuracy and low impact are critical.
C++ developers who need precise timing for benchmarking algorithms, performance testing, or profiling code across different platforms.
Developers choose plf::nanotimer for its minimal overhead and simplicity, offering reliable microsecond-precision timing without the complexity of larger benchmarking libraries.
A simple C++ 03/11/etc timer class for ~microsecond-precision cross-platform benchmarking. The implementation is as limited and as simple as possible to create the lowest amount of overhead.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides timing measurements in nanoseconds, microseconds, and milliseconds with high accuracy, as stated for cross-platform consistency in the README.
Implementation is deliberately limited and simple to reduce performance impact during benchmarking, ensuring low interference with code being measured.
Works consistently across different operating systems, making it suitable for benchmarking on various environments without modification.
Supports elapsed time retrieval in multiple units via separate member functions, allowing easy conversion without additional calculations.
Includes non-member functions for precise program delays, useful for testing or synchronization in benchmarking scenarios.
The README explicitly states that a pause function was omitted to avoid complexity, requiring manual workarounds like summing elapsed times, which can be error-prone.
Lacks advanced benchmarking features such as statistical analysis, event logging, or support for multiple concurrent timers, making it basic for complex performance analysis.
While cross-platform, microsecond precision isn't guaranteed on all hardware or operating systems, and nanosecond measurements may have reduced accuracy in practice.