0022312: Translation of french commentaries in OCCT files
[occt.git] / src / CDF / CDF_Timer.cxx
CommitLineData
7fd59977 1// File: CDF_Timer.cxx
2// Created: Fri Jul 17 08:08:27 1998
3// Author: Jean-Louis Frenkel
4// <rmi@frilox.paris1.matra-dtv.fr>
5
6
7#include <CDF_Timer.ixx>
8#include <stdlib.h>
9
10CDF_Timer::CDF_Timer() {
11 myTimer.Start();
12}
13
14
15void CDF_Timer::ShowAndRestart(const Standard_CString aMessage) {
16 if(MustShow()) {
17 Show(aMessage);
18 myTimer.Reset();
19 myTimer.Start();
20 }
21}
22
23void CDF_Timer::ShowAndStop(const Standard_CString aMessage) {
24 if(MustShow()) {
25 Show(aMessage);
26 myTimer.Stop();
27 }
28}
29
30void CDF_Timer::Show(const Standard_CString aMessage) {
31 Standard_Integer minutes,hours; Standard_Real seconds,CPUtime;
32 myTimer.Show(seconds,minutes,hours,CPUtime);
33 cout << aMessage << hours << "h " << minutes << "' " << seconds << "'' (cpu: " << CPUtime << ")" << endl;
34}
35Standard_Boolean CDF_Timer::MustShow() {
36 static Standard_Boolean theMustShow=getenv("STORETIMER") != NULL;
37 return theMustShow;
38}