0023065: This is desirable to add general DRAW command to estimate visualization...
[occt.git] / src / OSD / OSD_Timer.cdl
CommitLineData
b311480e 1-- Created on: 2018-03-15
2-- Created by: Stephan GARNAUD (ARM)
3-- Copyright (c) 1998-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
6-- The content of this file is subject to the Open CASCADE Technology Public
7-- License Version 6.5 (the "License"). You may not use the content of this file
8-- except in compliance with the License. Please obtain a copy of the License
9-- at http://www.opencascade.org and read it completely before using this file.
10--
11-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13--
14-- The Original Code and all software distributed under the License is
15-- distributed on an "AS IS" basis, without warranty of any kind, and the
16-- Initial Developer hereby disclaims all such warranties, including without
17-- limitation, any warranties of merchantability, fitness for a particular
18-- purpose or non-infringement. Please see the License for the specific terms
19-- and conditions governing the rights and limitations under the License.
20
7fd59977 21
7fd59977 22
7fd59977 23-- Updated: J.P. TIRAULT Sept,1993
7fd59977 24
25class Timer from OSD inherits Chronometer from OSD
26
27 ---Purpose: Working on heterogeneous platforms
28-- we need to use the system call gettimeofday.
29-- This function is portable and it measures ELAPSED
30-- time and CPU time in seconds and microseconds.
31 -- Example: OSD_Timer aTimer;
32 -- aTimer.Start(); // Start the timers (t1).
33 -- ..... // Do something.
34 -- aTimer.Stop(); // Stop the timers (t2).
35 -- aTimer.Show(); // Give the elapsed time between t1 and t2.
36 -- // Give also the process CPU time between
37 -- // t1 and t2.
38
39
40is
41
42 Create returns Timer from OSD;
43 ---Purpose: Builds a Chronometer initialized and stopped.
44 ---Level: Public
45
46 Reset (me : in out) is redefined;
47 ---Purpose: Stops and reinitializes the timer.
48 ---Level: Public
49
50 Show (me : in out) is redefined;
51 ---Purpose: Shows both the elapsed time and CPU time on the standard output
52 -- stream <cout>.The chronometer can be running (Lap Time) or
53 -- stopped.
54 ---Level: Public
55
56 Show (me : in out; os : in out OStream from Standard) is redefined;
57 ---Purpose: Shows both the elapsed time and CPU time on the
58 -- output stream <OS>.
59 ---Level: Public
60
61 Show (me : in out; seconds : in out Real from Standard;
62 minutes : in out Integer from Standard;
63 hours : in out Integer from Standard;
64 CPUtime : in out Real from Standard);
65
66 ---Purpose: returns both the elapsed time(seconds,minutes,hours)
67 -- and CPU time.
68 ---Level: Public
208e6839 69
7fd59977 70 Stop (me : in out) is redefined;
71 ---Purpose: Stops the Timer.
72 ---Level: Public
73
74 Start (me : in out) is redefined;
75 ---Purpose: Starts (after Create or Reset) or restarts (after Stop)
76 -- the Timer.
77 ---Level: Public
78
208e6839 79 ElapsedTime (me : in out) returns Real;
80 ---Purpose: Returns elapsed time in seconds.
81 ---Level: Public
82
7fd59977 83fields
84
85 TimeStart : Real;
86 TimeCumul : Real;
87
88end;