容易测量过的时间
printf("**MyProgram::before time= %ld\n", time(NULL));doSomthing();doSomthingLong();printf("**MyProgram::after time= %ld\n", time(NULL));
struct timeval diff, startTV, endTV;gettimeofday(&startTV, NULL); doSomething();doSomethingLong();gettimeofday(&endTV, NULL); timersub(&endTV, &startTV, &diff);printf("**time taken = %ld %ld\n", diff.tv_sec, diff.tv_usec);
**time taken = 0 26339
**time taken = 4 45025
四季花海
HUWWW
MMTTMM
相关分类