summaryrefslogtreecommitdiffstats
path: root/mailnews/base/public/nsIStopwatch.idl
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
commit302bf1b523012e11b60425d6eee1221ebc2724eb (patch)
treeb191a895f8716efcbe42f454f37597a545a6f421 /mailnews/base/public/nsIStopwatch.idl
parent21b3f6247403c06f85e1f45d219f87549862198f (diff)
downloadUXP-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/public/nsIStopwatch.idl')
-rw-r--r--mailnews/base/public/nsIStopwatch.idl44
1 files changed, 44 insertions, 0 deletions
diff --git a/mailnews/base/public/nsIStopwatch.idl b/mailnews/base/public/nsIStopwatch.idl
new file mode 100644
index 000000000..6e40ace07
--- /dev/null
+++ b/mailnews/base/public/nsIStopwatch.idl
@@ -0,0 +1,44 @@
+/* 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/. */
+#include "nsISupports.idl"
+
+/**
+ * Simple stopwatch mechanism for determining the amount of wall-clock time and
+ * CPU time (user + system) that has elapsed. It is not fancy. It is either
+ * running or it is not. If you want coherent cpu and real time values, then
+ * you had better stop it first. It does not keep counting when stopped,
+ * although one could add a resumeRetroactive or something to accomplish that.
+ */
+[scriptable, uuid(7a671d6e-d48f-4a4f-b87e-644815a5e381)]
+interface nsIStopwatch : nsISupports {
+ /**
+ * Start the stopwatch; all counters are reset to zero. If you want to
+ * keep the already accumulated values, use resume instead.
+ */
+ void start();
+
+ /**
+ * Stop the stopwatch.
+ */
+ void stop();
+
+ /**
+ * Resume the stopwatch without clearing the existing counters. Any time
+ * already accumulated on cpuTime/realTime will be kept.
+ */
+ void resume();
+
+ /**
+ * The total CPU time (user + system) in seconds accumulated between calls to
+ * start/resume and stop. You have to stop the stopwatch to cause this value
+ * to update.
+ */
+ readonly attribute double cpuTimeSeconds;
+ /**
+ * The total wall clock time in seconds accumulated between calls to
+ * start/resume and stop. You have to stop the stopwatch to cause this value
+ * to update.
+ */
+ readonly attribute double realTimeSeconds;
+};