An C implementation for benchmarking routines.
#include <benchmark.h>
....
typedef struct t_args {int seconds;} my_args;
void routine(void* args)
{
// Your really long routine
sleep(args->seconds);
}
...
int main()
{
my_args args = {1};
long int time = (long int) ustopwatch(routine, &args);
printf("Elapsed: %ld microseconds\n\n", time);
return 0;
}