Profiling: measure time on POSIX systems using clock_gettime