For dtime, the elapsed time is:
First call: elapsed time since start of execution
Subsequent calls: elapsed time since the last call to dtime
Single processor: time used by the CPU
Multiple Processor: the sum of times for all the CPUs, which is not useful data; use etime instead.
Do not call dtime from within a parallelized loop.
|
e = dtime( tarray ) |
|||
|---|---|---|---|
|
tarray |
real(2) |
Output |
e= -1.0: Error: tarray values are undefined e¬= -1.0: User time in tarray(1) if no error. System time in tarray(2) if no error |
|
Return value |
real |
Output |
e= -1.0: Error e¬= -1.0: The sum of tarray(1) and tarray(2) |
Example: dtime(), single processor:
real e, dtime, t(2)
print *, 'elapsed:', e, ', user:', t(1), ', sys:', t(2)
do i = 1, 10000
k=k+1
end do
e = dtime( t )
print *, 'elapsed:', e, ', user:', t(1), ', sys:', t(2)
end
demo% f77 -silent tdtime.f
demo% a.out
elapsed: 0., user: 0., sys: 0.
elapsed: 0.180000, user: 6.00000E-02, sys: 0.120000
demo%