BUG: DTIME() and ETIME() Return Zero Under Windows 95Last reviewed: February 29, 1996Article ID: Q147754 |
The information in this article applies to:
SYMPTOMSThe DTIME() and ETIME() functions incorrectly return zero for program execution and elapsed CPU time under Windows 95.
CAUSEWindows 95 does not support the underlying Win32 API function calls accessed by these functions. This does not apply to Windows NT 3.51.
RESOLUTIONUse the TIMEF() function to profile CPU timings under Windows 95.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe following program under Windows NT 3.51 produces the correct elapsed time results for DTIME() and ETIME(). The same code under Windows 95 causes zero to be returned as the result, while TIMEF() works correctly under both operating systems.
Sample CodeC Compile options need: none
USE PORTLIB REAL(4) DT0, DT1, ET0, ET1, TIMER(2) REAL(8) ELAPSED_TIME WRITE(*,*) 'Elapsed execution times...' WRITE(*,*) DT0 = DTIME(TIMER) CALL SPEND_TIME DT1 = DTIME(TIMER) WRITE(*, '(A14,F6.3,A8)') 'Using DTIME: ', DT1-DT0, 'seconds' ET0 = ETIME(TIMER) CALL SPEND_TIME ET1 = ETIME(TIMER) WRITE(*, '(A14,F6.3,A8)') 'Using ETIME: ', ET1-ET0, 'seconds'C Use the following code as a workaround under Windows 95
ELAPSED_TIME = TIMEF() CALL SPEND_TIME ELAPSED_TIME = TIMEF() WRITE(*, '(A14,F6.3,A8)') 'Using TIMEF: ', ELAPSED_TIME, 'seconds' END SUBROUTINE SPEND_TIME INTEGER I, J DO I = 1, 1000000 J = J**2 END DO END SUBROUTINE REFERENCESMicrosoft FORTRAN PowerStation 32 4.0 Books Online Readme.
|
Additional reference words: 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |