From 302bf1b523012e11b60425d6eee1221ebc2724eb Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 3 Nov 2019 00:17:46 -0400 Subject: Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1 --- mailnews/base/public/nsIStopwatch.idl | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 mailnews/base/public/nsIStopwatch.idl (limited to 'mailnews/base/public/nsIStopwatch.idl') 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; +}; -- cgit v1.2.3