01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.util;
05:
06: public class Timer {
07: public long start;
08: public long end;
09:
10: public void start() {
11: start = System.currentTimeMillis();
12: }
13:
14: public void stop() {
15: end = System.currentTimeMillis();
16: }
17:
18: public long elapsed() {
19: return end - start;
20: }
21:
22: public float tps(long t) {
23: return (float) t / elapsed() * 1000;
24: }
25: }
|