究竟上,clock_t的值转换为秒应该是除以CLOCKS_PER_SEC这个宏,而这个宏在Windows平台下是1000,而到了Linux平台下便是1000000了。 因此措施正确的写法是: #include clock_t start, stop; ... start = clock(); do_something(); stop = clock(); printf("%f", (double)(stop-start)/(double)CLOCKS_PER_...