#include <cstdio> #include "bench.h" void doStuff() { std::random_device random; std::uniform_real_distribution<double> uniform(-100, 100); volatile double foo = 0; for (std::size_t i=0; i<1000*1000; ++i) { foo += uniform(random); } } int main() { bench::WallTime<double> wallTime; // // Stoppuhr starten // wallTime.tic(); doStuff(); // // Stoppuhr stoppen // double elapsedSeconds = wallTime.toc(); printf("Time elapesd in seconds: %5.2lf\n", elapsedSeconds); } |