Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Wait function

michael_green
Beginner
949 Views
I would like to be able to enter a loop and have the loop wait for a specified time (say 0.1 sec) between iterations. I presume this involves the function SignalObjectAndWait. The online help gives me a plethora of confusing information, but what I really need is one small example. Please could someone show me that way.

With many thanks in advance

Mike
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
949 Views
You probably need plain Sleep (there are actually 3 versions, one from DFWIN, one from DFPORT, and SLEEPQQ from DFLIB, with slightly different semantics). SignalObjectAndWait, WaitForSingleObject & similar are used for inter-thread and inter-process synchronization.
Jugoslav
0 Kudos
pcurtis
Beginner
949 Views

RECURSIVE SUBROUTINE delay_ms (howmany)
USE kernel32
IMPLICIT NONE
INTEGER,INTENT(IN):: howmany

!Win32 suspend function, allows the timeslice to be
!used by other threads until the timeout elapses
IF (howmany > 0) CALL sleep (howmany)
END SUBROUTINE delay_ms

0 Kudos
Reply