------- Comment #1 from kargl at gcc dot gnu dot org  2009-08-24 17:19 -------
(In reply to comment #0)
> The following code was compiled with 
> gfortran -g -o test_dtime test_dtime.f
> 
> The code is given by (very similar to that given in the info file for gfortran
> 
>       program test_dtime
>       integer(8) :: i, j, k
>       real, dimension(2) :: tarray
>       real :: result
>       real :: accum
>       call dtime(tarray, result)
>       print '(''tarray,result:'', 1P, 3E20.11)', tarray, result
>       do i=1,100000000          ! Just a delay
>         j = i * i - i
>       end do
>       call dtime(tarray, result)
>       print '(''tarray,result:'', 1P, 3E20.11)', tarray, result
>       accum = 0.e0    ! Should accumulate 10 times previous tarray(1)
>       call dtime(tarray, result)
>       do k=1, 10
>         do i=1,100000000        ! Just a delay
>           j = i * i - i
>         end do
>         call dtime(tarray, result)
>         accum = accum + tarray(1)
>       end do
>       print '(''accum ='', 1P, E20.11 )', accum
>       end program test_dtime
> 
> The resulting output is 
> 
> tarray,result:   9.99000039883E-04   9.99000039883E-04   1.99800007977E-03
> tarray,result:   3.86941999197E-01   0.00000000000E+00   3.86941999197E-01
> accum =   1.35349416733E+01
> 
> Note that accum should be close to 10 times the value the tarray(1) above, 
> that
> is, close to 3.8.  I have no idea where the 13.5... came from.
>

Why should it be close to 3.8?

dtime returns the time since the start of the process?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41157

Reply via email to