System.nanoTime() 在 Linux 上的實作是先判斷系統是否支援 CLOCK_MONOTONIC,有就用 clock_gettime,沒有則用 gettimeofday
clock_gettime 拿來測 C 程式的效能比 clock 好用,再進 runlevel 1 去測就更讚了 😛
man clock_gettime 可看到 clock_gettime 詳細資料
System.nanoTime() 在 Linux 上的實作是先判斷系統是否支援 CLOCK_MONOTONIC,有就用 clock_gettime,沒有則用 gettimeofday
clock_gettime 拿來測 C 程式的效能比 clock 好用,再進 runlevel 1 去測就更讚了 😛
man clock_gettime 可看到 clock_gettime 詳細資料