diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 00:17:46 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 00:17:46 -0400 |
commit | 302bf1b523012e11b60425d6eee1221ebc2724eb (patch) | |
tree | b191a895f8716efcbe42f454f37597a545a6f421 /mailnews/base/util/nsStopwatch.h | |
parent | 21b3f6247403c06f85e1f45d219f87549862198f (diff) | |
download | UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.gz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.lz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.xz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.zip |
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
Diffstat (limited to 'mailnews/base/util/nsStopwatch.h')
-rw-r--r-- | mailnews/base/util/nsStopwatch.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mailnews/base/util/nsStopwatch.h b/mailnews/base/util/nsStopwatch.h new file mode 100644 index 000000000..62b1c52b8 --- /dev/null +++ b/mailnews/base/util/nsStopwatch.h @@ -0,0 +1,50 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef _nsStopwatch_h_ +#define _nsStopwatch_h_ + +#include "nsIStopwatch.h" + +#include "msgCore.h" + +#define NS_STOPWATCH_CID \ +{0x6ef7eafd, 0x72d0, 0x4c56, {0x94, 0x09, 0x67, 0xe1, 0x6d, 0x0f, 0x25, 0x5b}} + +#define NS_STOPWATCH_CONTRACTID "@mozilla.org/stopwatch;1" + +#undef IMETHOD_VISIBILITY +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT + +class NS_MSG_BASE nsStopwatch : public nsIStopwatch +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSISTOPWATCH + + nsStopwatch(); +private: + virtual ~nsStopwatch(); + + /// Wall-clock start time in seconds since unix epoch. + double fStartRealTimeSecs; + /// Wall-clock stop time in seconds since unix epoch. + double fStopRealTimeSecs; + /// CPU-clock start time in seconds (of CPU time used since app start) + double fStartCpuTimeSecs; + /// CPU-clock stop time in seconds (of CPU time used since app start) + double fStopCpuTimeSecs; + /// Total wall-clock time elapsed in seconds. + double fTotalRealTimeSecs; + /// Total CPU time elapsed in seconds. + double fTotalCpuTimeSecs; + + /// Is the timer running? + bool fRunning; + + static double GetRealTime(); + static double GetCPUTime(); +}; + +#endif // _nsStopwatch_h_ |