diff options
author | Matthew Newhook <matthew@zeroc.com> | 2002-03-12 16:52:38 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2002-03-12 16:52:38 +0000 |
commit | 229b505218af79219e2982b6547dcd0c02db8294 (patch) | |
tree | 85591b8279dbd2a235fbf02678296bb9f1d9cdca /java/demo/Freeze/bench/StopWatch.java | |
parent | another trivial bug fix (diff) | |
download | ice-229b505218af79219e2982b6547dcd0c02db8294.tar.bz2 ice-229b505218af79219e2982b6547dcd0c02db8294.tar.xz ice-229b505218af79219e2982b6547dcd0c02db8294.zip |
First version of demo/Freeze/bench.
Diffstat (limited to 'java/demo/Freeze/bench/StopWatch.java')
-rw-r--r-- | java/demo/Freeze/bench/StopWatch.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/java/demo/Freeze/bench/StopWatch.java b/java/demo/Freeze/bench/StopWatch.java new file mode 100644 index 00000000000..d481986538d --- /dev/null +++ b/java/demo/Freeze/bench/StopWatch.java @@ -0,0 +1,38 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +class StopWatch +{ + StopWatch() + { + } + + public void + start() + { + _stopped = false; + _start = System.currentTimeMillis(); + } + + public long + stop() + { + if (!_stopped) + { + _stop = System.currentTimeMillis(); + _stopped = true; + } + return _stop - _start; + } + + private boolean _stopped; + private long _start; + private long _stop; +} |