你的这个clock()函数算的是从1900年到现在的时间吧?
正如楼上所说,clock()函数返回的并不是毫秒。MSDN上的解释是
The elapsed time since the CRT initialization at the start of the process, measured in CLOCKS_PER_SEC units per second. clock()函数返回的是进程开始时CRT初始化所消耗的时间,以每秒的 CLOCKS_PER_SEC 来测量。
也就是说,clock()函数返回值是秒× CLOCKS_PER_SEC 。CLOCKS_PER_SEC并不是一个固定值。
RETURN VALUE
The value returned is the CPU time used so far as a clock_t; to get the number of seconds used, divide by CLOCKS_PER_SEC. If the processor time used is not available or its
value cannot be represented, the function returns the value (clock_t) -1.