summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/JACE/Timers/ProfileTimer.java46
-rw-r--r--java/JACE/Timers/package.html8
2 files changed, 54 insertions, 0 deletions
diff --git a/java/JACE/Timers/ProfileTimer.java b/java/JACE/Timers/ProfileTimer.java
new file mode 100644
index 00000000000..210d8887907
--- /dev/null
+++ b/java/JACE/Timers/ProfileTimer.java
@@ -0,0 +1,46 @@
+/*************************************************
+ *
+ * = PACKAGE
+ * JACE.Timers
+ *
+ * = FILENAME
+ * ProfileTimer.java
+ *
+ *@author Prashant Jain
+ *
+ *************************************************/
+package JACE.Timers;
+
+/**
+ * A Java wrapper for interval timers.
+ */
+public class ProfileTimer
+{
+ /**
+ * Start the timer.
+ */
+ public void start ()
+ {
+ this.startTime_ = java.lang.System.currentTimeMillis ();
+ }
+
+ /**
+ * Stop the timer.
+ */
+ public void stop ()
+ {
+ this.stopTime_ = java.lang.System.currentTimeMillis ();
+ }
+
+ /**
+ * Determine elapsed time between start and stop.
+ *@return Total elapsed time (stop - start).
+ */
+ public long elapsedTime ()
+ {
+ return this.stopTime_ - this.startTime_;
+ }
+
+ private long startTime_;
+ private long stopTime_;
+}
diff --git a/java/JACE/Timers/package.html b/java/JACE/Timers/package.html
new file mode 100644
index 00000000000..4aa67ec1fd6
--- /dev/null
+++ b/java/JACE/Timers/package.html
@@ -0,0 +1,8 @@
+<!-- $Id$ -->
+<HTML>
+<BODY>
+Time related classes.
+
+@see JACE.ASX.TimeValue
+</BODY>
+</HTML>