COPASI API  4.16.103
CCopasiTimer.cpp
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/report/CCopasiTimer.cpp,v $
3  $Revision: 1.10 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2012/04/04 19:17:43 $
7  End CVS Header */
8 
9 // Copyright (C) 2012 - 2011 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 #include "copasi.h"
19 
20 #include "CCopasiTimer.h"
21 #include "CCopasiContainer.h"
22 #include "CCopasiObjectReference.h"
23 
25  const CCopasiContainer * pParent):
26  CCopasiObject((type == CCopasiTimer::WALL) ? "Wall Clock Time" : "CPU Time",
27  pParent, "Timer", CCopasiObject::ValueDbl),
28  mType(type),
29  mStartTime(),
30  mElapsedTime(0),
31  mElapsedTimeSeconds(0)
32 {
33  switch (mType)
34  {
35  case WALL:
37  break;
38 
39  case PROCESS:
41  break;
42 
43  case THREAD:
45  break;
46 
47  }
48 
50 }
51 
52 
54  const CCopasiContainer * pParent):
55  CCopasiObject(src, pParent),
56  mType(src.mType),
57  mStartTime(src.mStartTime),
58  mElapsedTime(src.mElapsedTime),
59  mElapsedTimeSeconds(src.mElapsedTimeSeconds)
61 
63 {}
64 
66 {
67  switch (mType)
68  {
69  case WALL:
71  break;
72 
73  case PROCESS:
75  break;
76 
77  case THREAD:
79  break;
80  }
81 
82  mElapsedTime = 0;
84 
85  return true;
86 }
87 
89 {
90  switch (mType)
91  {
92  case WALL:
94  break;
95 
96  case PROCESS:
98  break;
99 
100  case THREAD:
102  break;
103  }
104 
106  (mElapsedTime.getMicroSeconds() * 1e-6);
107 
108  return;
109 }
110 
112 {
113  return mElapsedTime;
114 }
115 
117 {
118  return mElapsedTimeSeconds;
119 }
120 
121 void CCopasiTimer::print(std::ostream * ostream) const
122 {(*ostream) << mElapsedTimeSeconds;}
123 
125 {return & const_cast<CCopasiTimer *>(this)->mElapsedTimeSeconds;}
C_FLOAT64 mElapsedTimeSeconds
Definition: CCopasiTimer.h:113
void setRefresh(CType *pType, void(CType::*method)(void))
static CCopasiTimeVariable getThreadTime()
Definition: CopasiTime.cpp:206
CCopasiTimeVariable mElapsedTime
Definition: CCopasiTimer.h:108
static CCopasiTimeVariable getProcessTime()
Definition: CopasiTime.cpp:180
const CCopasiTimeVariable & getElapsedTime() const
CCopasiTimer(const Type &type=WALL, const CCopasiContainer *pParent=NULL)
static CCopasiTimeVariable getCurrentWallTime()
Definition: CopasiTime.cpp:160
const C_FLOAT64 & getElapsedTimeSeconds() const
CCopasiTimeVariable mStartTime
Definition: CCopasiTimer.h:103
Header file of class CCopasiContainer.
virtual void * getValuePointer() const
#define C_FLOAT64
Definition: copasi.h:92
C_INT64 getMicroSeconds(const bool &bounded=false) const
Definition: CopasiTime.cpp:112
virtual void print(std::ostream *ostream) const