All Projects → mattreecebentley → plf_nanotimer

mattreecebentley / plf_nanotimer

Licence: Zlib license
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.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to plf nanotimer

cb-tumblebug
Cloud-Barista Multi-Cloud Infra Management Framework
Stars: ✭ 33 (-69.44%)
Mutual labels:  benchmarking
chest xray 14
Benchmarks on NIH Chest X-ray 14 dataset
Stars: ✭ 67 (-37.96%)
Mutual labels:  benchmarking
scitime
Training time estimation for scikit-learn algorithms
Stars: ✭ 119 (+10.19%)
Mutual labels:  timer
dyngen
Simulating single-cell data using gene regulatory networks 📠
Stars: ✭ 59 (-45.37%)
Mutual labels:  benchmarking
lein-jmh
Leiningen plugin for jmh-clojure
Stars: ✭ 17 (-84.26%)
Mutual labels:  benchmarking
Splitter
A speedrunning timer for macOS
Stars: ✭ 34 (-68.52%)
Mutual labels:  timer
event pool
a header-only event-driven library based on c++11.
Stars: ✭ 27 (-75%)
Mutual labels:  timer
ES-Timer
A USB timer powered by Digispark ATtiny85 according to 🍅 pomodoro time management technique
Stars: ✭ 45 (-58.33%)
Mutual labels:  timer
meditation-timer
🧘 Progressive web application for timing your meditations
Stars: ✭ 23 (-78.7%)
Mutual labels:  timer
favloader
Vanilla JavaScript library for loading animation in favicon (favicon loader)
Stars: ✭ 20 (-81.48%)
Mutual labels:  timer
benchmark VAE
Unifying Variational Autoencoder (VAE) implementations in Pytorch (NeurIPS 2022)
Stars: ✭ 1,211 (+1021.3%)
Mutual labels:  benchmarking
consoleTimer
Simple timer for your terminal
Stars: ✭ 20 (-81.48%)
Mutual labels:  timer
langx-java
Java tools, helper, common utilities. A replacement of guava, apache-commons, hutool
Stars: ✭ 50 (-53.7%)
Mutual labels:  timer
nitroml
NitroML is a modular, portable, and scalable model-quality benchmarking framework for Machine Learning and Automated Machine Learning (AutoML) pipelines.
Stars: ✭ 40 (-62.96%)
Mutual labels:  benchmarking
CountdownTimer-TeLeTiPs
The very first powerful Telegram bot to countdown to your important events in any group chat. Live countdown timer (days : hours : minutes : seconds)
Stars: ✭ 122 (+12.96%)
Mutual labels:  timer
UnityTimer
Powerful and convenient library for running actions after a delay in Unity3D. Fork from akbiggs/UnityTimer. Add some useful functions.
Stars: ✭ 26 (-75.93%)
Mutual labels:  timer
ldbc snb docs
Specification of the LDBC Social Network Benchmark suite
Stars: ✭ 39 (-63.89%)
Mutual labels:  benchmarking
ILAMB
Python software used in the International Land Model Benchmarking (ILAMB) project
Stars: ✭ 28 (-74.07%)
Mutual labels:  benchmarking
stop watch timer
This is Stop Watch Timer for flutter plugin.🏃‍♂️
Stars: ✭ 76 (-29.63%)
Mutual labels:  timer
timer
🕚 A simple, beautiful cubing timer.
Stars: ✭ 26 (-75.93%)
Mutual labels:  timer

plf::nanotimer

A simple C++ 03/11/etc timer class for ~microsecond-precision cross-platform benchmarking. The implementation is as limited and simple as possible to afford the lowest amount of overhead.

Use as follows:

plf::nanotimer timer;


timer.start()

// Do something here

double results = timer.get_elapsed_ns();
std::cout << "Timing: " << results << " nanoseconds." << std::endl;


timer.start(); // "start" has the same semantics as "restart".

// Do something else

results = timer.get_elapsed_ms();
std::cout << "Timing: " << results << " milliseconds." << std::endl;


timer.start()

plf::microsecond_delay(15); // Delay program for 15 microseconds

results = timer.get_elapsed_us();
std::cout << "Timing: " << results << " microseconds." << std::endl;

Timer member functions:

void start(): start or restart timer

double get_elapsed_ns(): get elapsed time in nanoseconds

double get_elapsed_us(): get elapsed time in microseconds

double get_elapsed_ms(): get elapsed time in milliseconds

Non-member functions:

void plf::millisecond_delay(double x): delay the program until x milliseconds have passed

void plf::microsecond_delay(double x): delay the program until x microseconds have passed

void plf::nanosecond_delay(double x): delay the program until x nanoseconds have passed

Timer 'pausing':

I determined that a 'pause'-style function would add too much complexity to the class for simple benchmarking, which in turn might interfere with performance analysis, so if you need a 'pause' function do something like this:

plf::nanotimer timer;


timer.start()
// Do something here
double results = timer.get_elapsed_ns();

// Do something else - timer 'paused'

timer.start()

// Do stuff

results += timer.get_elapsed_ns();

std::cout << "Timing: " << results << " nanoseconds." << std::endl;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].