KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dappit > Dapper > parser > profiler > SimpleTimeProfiler


1 /**
2  *
3  */

4 package com.dappit.Dapper.parser.profiler;
5
6 /**
7  * @author Ohad Serfaty
8  *
9  */

10 public class SimpleTimeProfiler extends SimpleProfiler {
11       long startStamp;
12       
13       /**
14        *
15        */

16       public double report(String JavaDoc prefix)
17       {
18         long endStamp = System.currentTimeMillis();
19         double resultSeconds = (double)((double)(endStamp-startStamp)/1000.0);
20         System.err.println(prefix +" : " + resultSeconds +" sec.");
21         return resultSeconds;
22       }
23
24       /**
25        *
26        */

27       public void start() {
28         startStamp = System.currentTimeMillis();
29       }
30
31 }
32
Popular Tags