From the clock(3)
manual page:
The clock() function returns an approximation of processor time used by the program.
So the clock
function doesn't return the amount of time passed, but a number of "ticks" that your program have run. And as you know, in a multi-tasking system your program can be paused at any time to let other programs run.