The problem is clock() function is not allowed, but I have no idea how to deal with time() function in thread.
I think you can use gettimeofday() function to get the start time and end time. While this function work only in Linux. Please refer to :http://linux.die.net/man/2/gettimeofday
For this function in windows, please refer to :Equivalent of gettimeday() for Windows