Quote:
>>I need to find the function or routine name to get the number of seconds
>>from midnight. I am using Watcom fortran and cannot find it anywhere.
>>I know the function is called 'SECNDS()' in Digital FORTRAN. I am
>>trying to compare computer run time with my simulation time. I can
>>already get the time and date expressions, but I was trying not to write
>>a routine to convert these into seconds to do calculations with. If
>>anyone has suggetions or alternative function names I would be greatful.
>CALL GETTIM(HRS,MINS,SECS,HSECS)
>Deano
>>Thanks,
>>Bill
Make sure hrs,mins,secs,hsecs are as integer*2 variables !
You also have to put " include 'fsublib.fi' " at the beginning
of your program segment.
chris
... to get better timing you can read the "clock tic" counter
(18ms/tic ??? -- I've forgotten already !!!)
Here is how I used it as an elapsed time (on a 386) with WATCOM
Fortan 77 (version 10.6):
In the calling routine (which also has a copy of the ctick
function) I say:
iset=ctick()+100
(e.g I want to timeout in 100 ticks.) Then a negative value of
itimout(iset) indicates "time-out". There is a fiddle in itimout
so it doesn't wrap around at the end of the day (when the clocktic
counter re-starts)
Of course this is only accurate to 18ms or your max. delay
in calling it - whichever is bigger
==============program======================
function itimout(iset)
C DOS32 WATCOM Fortran 77 ver. 10.6
*$pragma aux ctick = "push es" "mov ax,0040h" "mov es,ax" \
* "mov eax,es:[006ch]" "pop es" \
* parm (value) [eax]
SAVE
integer*4 iset,itimout,ctick
itimout= mod(iset- ctick(), '1800b0'x)
if(itimout.ge.'c0058'x)itimout=itimout-'1800b0'x
return
end
===========================================
chris