cunixposixclockfreebsd

How to get real clock per sec in FreeBSD?


Anybody knows, how to get real value of clock per sec? clock() from time.h returns clocks from start of my process, so it need to be divided by CLOCKS_PER_SEC, but this constant has always value 1000000.

Is there some POSIX standard for this?


Solution

  • That's how it specified in the C specification.

    If you want to measure elapsed time, there are other (and better) functions, like gettimeofday for example.