Fortran intrinsic timing routines, which is better? cpu_time or system_clock

前端 未结 4 549
再見小時候
再見小時候 2020-12-03 09:54

When timing a FORTRAN program i usually just use the command call cpu_time(t).
Then i stumbled across call system_clock([count,count_rate,count_max])<

4条回答
  •  生来不讨喜
    2020-12-03 10:37

    These two intrinsics report different types of time. system_clock reports "wall time" or elapsed time. cpu_time reports time used by the CPU. On a multi-tasking machine these could be very different, e.g., if your process shared the CPU equally with three other processes and therefore received 25% of the CPU and used 10 cpu seconds, it would take about 40 seconds of actual elapsed or wall clock time.

提交回复
热议问题