change clock function to clock_gettime