sc/perf/perf_example.c

23 lines
296 B
C
Raw Normal View History

2020-11-11 01:19:49 +03:00
#include "sc_perf.h"
#include <stdlib.h>
2020-11-11 01:19:49 +03:00
2021-02-07 22:31:04 +03:00
int main()
2020-11-11 01:19:49 +03:00
{
size_t total = 0;
2020-11-11 01:19:49 +03:00
sc_perf_start();
for (int i = 0; i < 100000000; i++) {
total += (rand() % 331) ^ 33;
}
sc_perf_pause();
2020-11-11 01:19:49 +03:00
for (int i = 0; i < 100000000; i++) {
total += (rand() % 327) ^ 37;
}
2020-11-11 01:19:49 +03:00
sc_perf_end();
2020-11-11 01:19:49 +03:00
return total;
2020-11-11 01:19:49 +03:00
}