Normand Briere
2018-07-07 09ddd38fd4a8a7100c834a5e976f4796fae53541
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package timeflow.util;
 
import java.util.*;
 
public class TimeIt {
   public static long last;
   static HashMap<Object, Long> marks=new HashMap<Object, Long>();
   
   public static void mark()
   {
       last=System.currentTimeMillis();
   }
   
   public static void sinceLast()
   {
       long now=System.currentTimeMillis();
       System.out.println("TimeIt: "+(now-last));
       last=now;
   }
   
   public static void since(Object o)
   {
       long now=System.currentTimeMillis();
       System.out.println("TimeIt: "+o+": "+(now-last));
       last=now;
   }
   
   public static void mark(Object o)
   {
       long now=System.currentTimeMillis();
       marks.put(o, System.currentTimeMillis());
       last=now;
   }
}