TIME.INC 768 B

1234567891011121314151617181920212223
  1. FUNCTION Time:Real;
  2. {
  3. Get time from system clock, convert Hours, Minutes, Seconds,
  4. and Hundredths of Seconds to time in Seconds. This makes it
  5. easy to measure elapsed time by subtracting one time from a
  6. later time.
  7. }
  8. TYPE Register_Type = Record
  9. AX, BX, CX, DX : Integer
  10. End;
  11. VAR
  12. Reg : Register_Type;
  13. BEGIN
  14. Reg.AX := $2C00;
  15. Intr($21,Reg);
  16. Time := (Reg.CX shr 8) * 3600 {Hours }
  17. + (Reg.CX and $00FF) * 60 {Minutes }
  18. + (Reg.DX shr 8) { * 1 } {Seconds }
  19. + (Reg.DX and $00FF) / 100 ; {Hundredths }
  20. END;
  21.