1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0032897: Tests - include elapsed time into test log

Added "ELAPSED TIME" to test case log.
Improved syntax of chrono/dchrono command:
added -elapsed, -userCPU, -sysCPU options printing individual values in seconds.

OSD_Chronometer::IsThisThreadOnly() - added missing accessors to the property.
This commit is contained in:
kgv
2022-03-30 21:38:14 +03:00
committed by smoskvin
parent ab279b126b
commit 2491eec38b
8 changed files with 218 additions and 221 deletions

View File

@@ -14,8 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <OSD_Chronometer.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_Stream.hxx>
#ifndef _WIN32
@@ -182,6 +183,19 @@ OSD_Chronometer::~OSD_Chronometer()
{
}
//=======================================================================
//function : SetThisThreadOnly
//purpose :
//=======================================================================
void OSD_Chronometer::SetThisThreadOnly (Standard_Boolean theIsThreadOnly)
{
if (!myIsStopped)
{
throw Standard_ProgramError ("OSD_Chronometer::SetThreadOnly() called for started Timer");
}
myIsThreadOnly = theIsThreadOnly;
}
//=======================================================================
//function : Reset
//purpose :

View File

@@ -91,6 +91,14 @@ public:
return aSysTime;
}
//! Return TRUE if current thread CPU time should be measured,
//! and FALSE to measure all threads CPU time; FALSE by default,
Standard_Boolean IsThisThreadOnly() const { return myIsThreadOnly; }
//! Set if current thread (TRUE) or all threads (FALSE) CPU time should be measured.
//! Will raise exception if Timer is in started state.
Standard_EXPORT void SetThisThreadOnly (Standard_Boolean theIsThreadOnly);
//! Returns the current CPU user time in a variable.
//! The chronometer can be running (laps Time) or stopped.
void Show (Standard_Real& theUserSeconds) const { theUserSeconds = UserTimeCPU(); }