DiscussionsIssue archiveOCCT:Foundation Classes

Archived issue #0029349

Foundation Classes, OSD_Timer - add missing theThisThreadOnly constructor option available in OSD_Chronometer

Open CASCADEOCCT:Foundation Classesclosed10 public notes

Search issues

Description

OSD_Timer constructor does not provide options for initializing OSD_Chronometer, making it stuck on measuring whole process CPU time, which makes OSD_Chronometer within OSD_Timer instance a useless burden in case if thread-only time should be measured instead.

Steps to reproduce

N/A

Public activity

10 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue Nov 28 08:42:40 2017 +0300

    0029349: Foundation Classes, OSD_Timer - add missing theThisThreadOnly constructor option available in OSD_Chronometer
    
    OSD_Timer constructor now has theThisThreadOnly option passed to OSD_Chronometer,
    which is FALSE by default.
    
    OSD_Chronometer now provides methods ::UserTimeCPU(), ::SystemTimeCPU() allowing
    to fetch CPU times without akward syntax through overloaded ::Show().
02Author
Patch is ready for review.
03Commenter 3
Some remarks:

1. OSD_Chronometer::timeToHoursMinutesSeconds() is public but starts with lower case -- should be either private or starting with uppercase

2. Method timeToHoursMinutesSeconds() is defined in OSD_Chronometer but used only in OSD_Timer; please move closer to location where it is used. Do we need it to be public at all?

3. Method OSD_Chronometer::Show (Standard_OStream& os) could be refactored to call Show(Standard_Real& theUserSec, Standard_Real& theSystemSec) to avoid code duplication for querying time

4. I see no reason to move implementation of the latter method Show() to header -- it is better to keep it in CXX
04Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
05Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue Nov 28 08:42:40 2017 +0300

    0029349: Foundation Classes, OSD_Timer - add missing theThisThreadOnly constructor option available in OSD_Chronometer
    
    OSD_Timer constructor now has theThisThreadOnly option passed to OSD_Chronometer,
    which is FALSE by default.
    
    OSD_Chronometer now provides methods ::UserTimeCPU(), ::SystemTimeCPU() allowing
    to fetch CPU times without akward syntax through overloaded ::Show().
06Author
07Commenter 7
No remarks, please test
08Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 20046.18000000047 / 19837.270000000357 [+1.05%]
Products
Total CPU difference: 8020.620000000084 / 8039.350000000084 [-0.23%]
Windows-64-VC10:
OCCT
Total CPU difference: 17896.34111939866 / 17832.614710898575 [+0.36%]
Products
Total CPU difference: 8019.57460719996 / 8019.621407499985 [-0.00%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
09Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]
10Commenter 2
Branch [archived branch] has been deleted by Author.

[revision removed]