In addition to sleske's answer I wrote a C program that will print the "OS ticks per second" ft
:
// C headers
#include <stdio.h>
// Posix headers
#include <unistd.h>
int main(int argc, char * argv[]){
long ft; // OS ticks per second
t = sysconf(_SC_CLK_TCK);
printf("ft = %ld\n\n", ft);
return 0;
}
In my case I am on OS Linux Debian system and when I compile this C program and run it, it will always print ft = 100
. Note that here unit is not written but it is "ticks per second". Therefore this is a frequency! We can write it with a unit:
ft = 100 1/s
If we want to get a period t
out of frequency ft
this equation is the missing link.
t = 1/ft
⟹ t = 1/(100 1/s)
⟹ t = 1/100 s
Let's convert this in ˙ms˙:
t = 1/100 s = (1 * 10^(-3)) s / (100 * 10^(-3)) = 1 * m s / (100 * 10^(-3)) = 1 * m s * 10^3 * 10^(-2) = 10^4 ms = 10 ms
.
So tick happens every 10 ms
on OS Linux Debian.