0022484: UNICODE characters support
[occt.git] / src / OSD / OSD_Timer.cdl
1 -- Created on: 2018-03-15
2 -- Created by: Stephan GARNAUD (ARM)
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 -- Updated:       J.P. TIRAULT Sept,1993
18
19 class Timer from OSD inherits Chronometer from OSD
20
21  ---Purpose: Working on heterogeneous platforms
22 -- we need to use the system call gettimeofday.
23 -- This function is portable and it measures ELAPSED
24 -- time and CPU time in seconds and microseconds.
25  -- Example: OSD_Timer aTimer;
26  --          aTimer.Start();   // Start  the timers (t1). 
27  --           .....            // Do something.
28  --          aTimer.Stop();    // Stop the timers (t2).
29  --          aTimer.Show();    // Give the elapsed time between t1 and t2.
30  --                            // Give also the process CPU time between 
31  --                            // t1 and t2.
32  
33
34 is
35
36   Create returns Timer from OSD;
37   ---Purpose: Builds a Chronometer initialized and stopped.
38   ---Level: Public
39
40   Reset (me : in out) is redefined;
41   ---Purpose: Stops and reinitializes the timer.
42   ---Level: Public
43
44   Show (me : in out) is redefined;
45   ---Purpose: Shows both the elapsed time and CPU time on the standard output 
46   --          stream <cout>.The chronometer can be running (Lap Time) or
47   --          stopped.
48   ---Level: Public
49
50   Show  (me : in out; os : in out OStream from Standard) is redefined;
51   ---Purpose: Shows both the elapsed time and CPU  time on the  
52   --          output stream <OS>.
53   ---Level: Public
54
55   Show  (me : in out; seconds     : in out Real    from Standard;
56                       minutes     : in out Integer from Standard;
57                       hours       : in out Integer from Standard;
58                       CPUtime     : in out Real    from Standard);
59                       
60   ---Purpose: returns both the elapsed time(seconds,minutes,hours) 
61   --          and CPU  time.
62   ---Level: Public
63
64   Stop (me : in out) is redefined;
65   ---Purpose: Stops the Timer.
66   ---Level: Public
67
68   Start (me : in out) is redefined;
69   ---Purpose: Starts (after Create or Reset) or restarts (after Stop)
70   --          the Timer.
71   ---Level: Public
72
73   ElapsedTime (me : in out) returns Real;
74   ---Purpose: Returns elapsed time in seconds.
75   ---Level: Public
76
77 fields
78
79   TimeStart : Real;
80   TimeCumul : Real;
81
82 end;