fol21 / benchmarker

An C implementation for benchmarking routines.
GNU General Public License v3.0
1 stars 0 forks source link

benchmarker

An C implementation for benchmarking routines.

Como usar

#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;
 }