Category : Modula II Source Code
Archive   : TASKING.ZIP
Filename : CLOCKUTI.MOD

 
Output of file : CLOCKUTI.MOD contained in archive : TASKING.ZIP
IMPLEMENTATION MODULE ClockUtilities;

FROM TimeDate IMPORT Time, GetTime;
FROM DateUtilities IMPORT DateDifference;

PROCEDURE TimeDifference( start, end: Time): REAL;
VAR
days, dif1, dif2: REAL;
BEGIN
IF start.day = end.day THEN
days := 0.0;
ELSIF start.day < end.day THEN
days := FLOAT(DateDifference(start, end));
ELSE
days := - FLOAT(DateDifference(end, start));
END;
IF end.minute >= start.minute THEN
dif1 := FLOAT( end.minute - start.minute );
ELSE
dif1 := - FLOAT( start.minute - end.minute );
END;
IF end.millisec >= start.millisec THEN
dif2 := FLOAT( end.millisec - start.millisec );
ELSE
dif2 := - FLOAT( start.millisec - end.millisec );
END;
RETURN (days * 1440.0 + dif1) * 60.0 + dif2 / 1000.0;
END TimeDifference;

PROCEDURE Pause(secs: REAL);
VAR
start, end: Time;
BEGIN
GetTime(start);
REPEAT
GetTime(end);
UNTIL TimeDifference(start,end) >= secs;
END Pause;

END ClockUtilities.


  3 Responses to “Category : Modula II Source Code
Archive   : TASKING.ZIP
Filename : CLOCKUTI.MOD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/