File: Clock.mi

package info (click to toggle)
mocka 9905-2
  • links: PTS
  • area: non-free
  • in suites: potato, sarge, woody
  • size: 5,436 kB
  • ctags: 160
  • sloc: asm: 23,203; makefile: 124; sh: 102; ansic: 23
file content (37 lines) | stat: -rw-r--r-- 924 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(******************************************************************************)
(* Copyright (c) 1988 by GMD Karlruhe, Germany				      *)
(* Gesellschaft fuer Mathematik und Datenverarbeitung			      *)
(* (German National Research Center for Computer Science)		      *)
(* Forschungsstelle fuer Programmstrukturen an Universitaet Karlsruhe	      *)
(* All rights reserved.							      *)
(******************************************************************************)

IMPLEMENTATION MODULE Clock;

   FROM SysLib IMPORT
      times, tms;

   VAR t0: tms;

   PROCEDURE ResetClock;
   BEGIN
      times(t0);
   END ResetClock;

   PROCEDURE UserTime() : INTEGER;
      VAR t: tms;
   BEGIN
      times(t);
      RETURN t.utime - t0.utime
   END UserTime;

   PROCEDURE SystemTime() : INTEGER;
      VAR t: tms;
   BEGIN
      times(t);
      RETURN t.stime - t0.stime
   END SystemTime;

BEGIN
   ResetClock;
END Clock.