struct timeval now, last;
正確用法:gettimeofday(&now, NULL);
錯誤:缺少參數,gettimeofday(&now); ,這會影響其他的timeval資料,可能會寫到 last 變數裡(寫入值可能是:20 FE FF FF)。
Tested:
sizeof(struct timeval) =16 bytes on CentOS 64-bitsizeof(struct timeval) = 8 bytes on Fedora 9 32-bit