📄 wy__times.h
字号:
/* Copyright is licensed under GNU LGPL. by I.J.Wang 2005 Class for process time statistics (wrapper of struct tms)*/#ifndef WY__TIMES_H__#define WY__TIMES_H__#include <sys/times.h>#include "wytimespec.h"class Wy__Times { struct tms _tc; public: static const char class_name[]; WY_THROW_REPLY; // [Syn] Construct default object // // utime()= 0 // stime()= 0 // cutime()= 0 // cstime()= 0 // Wy__Times() WY__TSPC(); // [Syn] Copy constructor // Wy__Times(const Wy__Times&) WY__TSPC(); // [Syn] Get user time // // [Ret] user CPU clock time in *this // clock_t utime(void) const WY__TSPC() { return _tc.tms_utime; }; // [Syn] Get system time // // [Ret] system CPU clock time in *this // clock_t stime(void) const WY__TSPC() { return _tc.tms_stime; }; // [Syn] Get children user time // // [Ret] children user CPU clock time in *this // clock_t cutime(void) const WY__TSPC() { return _tc.tms_cutime; }; // [Syn] Get children system time // // [Ret] children system CPU clock time in *this // clock_t cstime(void) const WY__TSPC() { return _tc.tms_cstime; }; // [Syn] Load *this with process times ?? // // [Ret] Ok // ... // WyRet load_times(void); const Wy__Times& operator =(const Wy__Times&) WY__TSPC(); // [Syn] Compute the time difference // // [Throw] Reply // Wym_EDIVZERO // // [Ret] WyTimeSpec of the value (t2-t1)/divr // // Example: // t1.load_times(); // ... // t2.load_times(); // diff(t1.utime(),t2.utime(),::sysconf(_SC_CLK_TCK)); // static WyTimeSpec diff(clock_t t2, clock_t t1, clock_t divr);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -