Watcom time function 
Author Message
 Watcom time function


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



Sun, 08 Oct 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Need help with timing statistics and timing details function

2. BIOS int 13h, Function 08h with Watcom problem...

3. Watcom--special functions

4. eof() function in Watcom

5. Watcom Support (was RE:Watcom on the net)

6. Bug in time.c (was Time.times problems)

7. time and scheduling (was: bug report: [ #447945 ] time.time() is not non-decreasing)

8. time zones, daylight saving time, and universal time

9. Time calculation functions anyone ?

10. Free class for Clarion 4/5 - Date and time elapsed functions

11. TIME function DOS vs. CLIPPER

12. Time Slice function

 

 
Powered by phpBB® Forum Software