This C++ script lets you do multiple execution timings.
To run a full execution timing, time
should be called twice. First to define the start-time and later again to calculate the completion-time. It will be reset and be ready for re-use when it is called again.
#include <iostream>
#include "execution_timer.h"
int main()
{
execution_timer.time(0x01);
for (int i=0; i<1000000; i++);
std::cout << "Completed in " << execution_timer.time(0x01) << "ms" << std::endl;
execution_timer.time(0x02);
for (int j=0; j<99999999; j++);
std::cout << "Completed in " << execution_timer.time(0x02) << "ms" << std::endl;
return 0;
}
A unique uuid
for each timer is necessary for assigning timespans
long long time (int uuid = 0);
@return (long long)
Returns time completion in milliseconds