-
Notifications
You must be signed in to change notification settings - Fork 1
Usage
#Benchmarking Scripts for C-language This set of scripts is intended for measuring the amount of clock cycles spent in a computation. Functions that take only few milliseconds result difficult to compare, instead measuring clock cycles is a better approach. Additionally, comparing between different computers allows to isolate the effects of different clock frequencies.
This is a unsigned variable that must be defined before measuring.
unsigned long long BENCH = 1000;
The clocks function measures the clock cycles of a specified function. Measuring is taken right before and after the function is called.
CLOCKS(RANDOM,FUNCTION)
FUNCTION is called BENCH x BENCH times, every BENCH times the RANDOM function is called.
This function measures time, operations per second and clock cycles. It can be used to measure throughput of a function.
oper_second(RANDOM, FUNCTION)
FUNCTION is called 10^6 times.