POSIX

“POSIX” == “Portable Operating System Interface”

use “clock_gettime” instead of “gettimeofday”

在 POSIX 2008 時,已經把 gettimeofday 淘汰,推薦使用 clock_gettime , 目前 Linux 和 FreeBSD 都有支援,但是 Mac OS 和 Windows 都不支援。

POSIX.1-2008 marks gettimeofday() as obsolete, recommending
the use of clock_gettime(2) instead.