ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PerfMon::Clock Struct Reference

#include <PerfMonEventDict.h>

Collaboration diagram for PerfMon::Clock:

Public Member Functions

 Clock ()
 
struct timespec diff ()
 

Static Public Member Functions

static struct timespec resolution ()
 

Public Attributes

struct timespec start
 
struct timespec stop
 

Detailed Description

Definition at line 30 of file PerfMonEventDict.h.

Constructor & Destructor Documentation

◆ Clock()

PerfMon::Clock::Clock ( )
inline

Definition at line 46 of file PerfMonEventDict.h.

47  : stop()
48  {
49  this->start = PerfMon::clock_gettime();
50  }

Member Function Documentation

◆ diff()

struct timespec PerfMon::Clock::diff ( )
inline

Definition at line 46 of file PerfMonEventDict.h.

52  {
53  this->stop = PerfMon::clock_gettime();
54  struct timespec delta;
55  if ((stop.tv_nsec-start.tv_nsec)<0) {
56  delta.tv_sec = stop.tv_sec-start.tv_sec-1;
57  delta.tv_nsec = 1000000000+stop.tv_nsec-start.tv_nsec;
58  } else {
59  delta.tv_sec = stop.tv_sec-start.tv_sec;
60  delta.tv_nsec = stop.tv_nsec-start.tv_nsec;
61  }
62  return delta;
63  }

◆ resolution()

static struct timespec PerfMon::Clock::resolution ( )
inlinestatic

Definition at line 1 of file PerfMonEventDict.h.

36  {
37  struct timespec r;
38 #ifndef __APPLE__
39  /*sc*/clock_getres(CLOCK_PROCESS_CPUTIME_ID, &r);
40 #endif
41  // std::cout << "::pmon:: resolution: " << r.tv_sec << ":" << r.tv_nsec
42  // << std::endl;
43  return r;
44  }

Member Data Documentation

◆ start

struct timespec PerfMon::Clock::start

Definition at line 1 of file PerfMonEventDict.h.

◆ stop

struct timespec PerfMon::Clock::stop

Definition at line 1 of file PerfMonEventDict.h.


The documentation for this struct was generated from the following file:
beamspotman.r
def r
Definition: beamspotman.py:676
PerfMon::clock_gettime
struct timespec clock_gettime()
Definition: PerfMonEventDict.h:21
PerfMon::Clock::start
struct timespec start
Definition: PerfMonEventDict.h:32
PerfMon::Clock::stop
struct timespec stop
Definition: PerfMonEventDict.h:33