25 # include <mach/mach_init.h>
26 # include <mach/task.h>
28 # include <sys/time.h>
29 # include <sys/resource.h>
30 # ifndef RUSAGE_THREAD
31 # define RUSAGE_THREAD 1
78 std::stringstream Iso;
122 if (bounded)
return MilliSeconds %
LLONG_CONST(1000);
123 else return MilliSeconds;
163 gettimeofday(&ttt, 0);
173 LARGE_INTEGER SystemTime;
174 GetSystemTimeAsFileTime((FILETIME *) &SystemTime);
183 LARGE_INTEGER CreationTime;
184 LARGE_INTEGER ExitTime;
185 LARGE_INTEGER KernelTime;
186 LARGE_INTEGER UserTime;
188 GetProcessTimes(GetCurrentProcess(),
189 (FILETIME *) &CreationTime,
190 (FILETIME *) &ExitTime,
191 (FILETIME *) &KernelTime,
192 (FILETIME *) &UserTime);
194 return (KernelTime.QuadPart + UserTime.QuadPart) /
LLONG_CONST(10);
197 struct rusage ResourceUsage;
199 getrusage(RUSAGE_SELF, &ResourceUsage);
202 + (
C_INT64) ResourceUsage.ru_utime.tv_usec;
209 LARGE_INTEGER CreationTime;
210 LARGE_INTEGER ExitTime;
211 LARGE_INTEGER KernelTime;
212 LARGE_INTEGER UserTime;
214 GetThreadTimes(GetCurrentThread(),
215 (FILETIME *) &CreationTime,
216 (FILETIME *) &ExitTime,
217 (FILETIME *) &KernelTime,
218 (FILETIME *) &UserTime);
220 return (KernelTime.QuadPart + UserTime.QuadPart) /
LLONG_CONST(10);
224 struct thread_basic_info t_info;
225 mach_msg_type_number_t t_info_count = THREAD_BASIC_INFO_COUNT;
227 if (KERN_SUCCESS != task_info(mach_task_self(),
228 THREAD_BASIC_INFO, (task_info_t) & t_info, & t_info_count))
234 + (
C_INT64) t_info.user_time.microseconds;
237 struct rusage ResourceUsage;
242 + (
C_INT64) ResourceUsage.ru_utime.tv_usec;
std::string isoFormat() const
static CCopasiTimeVariable getThreadTime()
static CCopasiTimeVariable getProcessTime()
C_INT64 getHours(const bool &bounded=false) const
bool operator<(const CCopasiTimeVariable &value)
static std::string LL2String(const C_INT64 &value, const C_INT32 &digits=0)
C_INT64 getMinutes(const bool &bounded=false) const
static CCopasiTimeVariable getCurrentWallTime()
CCopasiTimeVariable operator+(const CCopasiTimeVariable &value)
C_INT64 getSeconds(const bool &bounded=false) const
std::string StringPrint(const char *format,...)
C_INT64 getMicroSeconds(const bool &bounded=false) const
CCopasiTimeVariable & operator=(const CCopasiTimeVariable &rhs)
CCopasiTimeVariable operator-(const CCopasiTimeVariable &value)
C_INT64 getMilliSeconds(const bool &bounded=false) const