CMS 3D CMS Logo

Public Member Functions | Public Attributes

cmsPerfSuite::PerfSuiteTimer Class Reference

List of all members.

Public Member Functions

def __init__
def get_duration
def get_end
def get_start
def set_end
def set_start

Public Attributes

 duration
 duration_hours
 duration_minutes
 duration_seconds
 end
 start

Detailed Description

A class defining timing objects to time the running of the various parts of the performance suite. The class depends on module datetime.

Definition at line 31 of file cmsPerfSuite.py.


Constructor & Destructor Documentation

def cmsPerfSuite::PerfSuiteTimer::__init__ (   self,
  start = None 
)
Initialize the start time and set the end time to some indefinite time in the future

Definition at line 33 of file cmsPerfSuite.py.

00034                                 :
00035       """Initialize the start time and set the end time to some indefinite time in the future"""
00036       self.start = start
00037       self.end = datetime.datetime.max
00038       self.duration = self.start - self.end


Member Function Documentation

def cmsPerfSuite::PerfSuiteTimer::get_duration (   self)
Return the duration between start and end as a dictionary with keys 'hours', 'minutes', 'seconds' to express the total duration in the favourite (most appropriate) unit. The function returns truncated integers.

Definition at line 53 of file cmsPerfSuite.py.

00054                          :
00055       """Return the duration between start and end as a dictionary with keys 'hours', 'minutes', 'seconds' to express the total duration in the favourite (most appropriate) unit. The function returns truncated integers."""
00056       self.duration_seconds = self.duration.days*86400 + self.duration.seconds
00057       self.duration_minutes = self.duration_seconds/60
00058       self.duration_hours = self.duration_seconds/3600
00059       return {'hours':self.duration_hours, 'minutes':self.duration_minutes, 'seconds':self.duration_seconds}

def cmsPerfSuite::PerfSuiteTimer::get_end (   self)
Return the end time in ctime timestamp format

Definition at line 50 of file cmsPerfSuite.py.

00051                     :
00052       """Return the end time in ctime timestamp format"""
      return self.end.ctime()
def cmsPerfSuite::PerfSuiteTimer::get_start (   self)
Return the start time in ctime timestamp format

Definition at line 47 of file cmsPerfSuite.py.

00048                       :
00049       """Return the start time in ctime timestamp format"""
      return self.start.ctime()
def cmsPerfSuite::PerfSuiteTimer::set_end (   self,
  end = None 
)

Definition at line 42 of file cmsPerfSuite.py.

00043                              :
00044       #print "Setting end time to %s"%end.ctime()
00045       self.end = end
      self.duration = self.end - self.start
def cmsPerfSuite::PerfSuiteTimer::set_start (   self,
  start = None 
)

Definition at line 40 of file cmsPerfSuite.py.

00041                                  :
      self.start = start

Member Data Documentation

Definition at line 33 of file cmsPerfSuite.py.

Definition at line 53 of file cmsPerfSuite.py.

Definition at line 53 of file cmsPerfSuite.py.

Definition at line 53 of file cmsPerfSuite.py.

Definition at line 33 of file cmsPerfSuite.py.

Definition at line 33 of file cmsPerfSuite.py.