Quoted from LitusSaxonicum
Since your SLEEP subroutine contains no code, it shold certainly execute much faster than 100 seconds!
Thanks LitusSaxonicum. My intention is to stop the processing of data during a small time, so that the processor stops the full-time usage (100% usage).
If you want to put code into it in the form of a loop, you could repeatedly call one of the FTN95 time-and-date routines (there are many of them - see the help file) and check if 100 seconds have elapsed. Store the first time you get, and compare the new time to that. RETURN when the 100 seconds have elapsed.
However, you will still be disappointed, as there is no way that your code changes the year, which will always report 2007 - even if you run this in 2008.
If you don't want your SLEEP routine to fail if called around midnight, then you have to watch for that case and adjust accordingly.
May be this subroutine makes that:
*Program asd
INTEGER SECONDS
....
CALL CPU_TIME(TIME1)
....
CALL CPU_TIME(TIME2)
SECONDS = TIME2 - TIME1
IF SECONDS > 100 THEN
???
???
END IF
...
...
...
....
END
SUBROUTINE CPU_TIME(TIME)
REAL,INTENT(OUT)::TIME
END SUBROUTINE*
After knowing that seconds is > 100 how do I stop the processing?
Turning now to the code you posted, if you run it through FTN95, you will see that your program and the subroutine are both named SLEEP - something FTN95 doesn't think much of. Correct (say) the program name to SLEEPER and it runs.
Just what did you expect to happen?
E
Yes it runned. However it didn't 'sleeped' :?
Thanks.