Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

IntervalTimer.java

00001 package edu.virtualschool.jwaa;
00002 
00007 public class IntervalTimer
00008 {
00009   long time;
00010   public IntervalTimer()
00011   {
00012     time = System.currentTimeMillis();
00013   }
00014   public long getMsec()
00015   {
00016     return System.currentTimeMillis();
00017   }
00018   public long getInterval()
00019   {
00020     long then = time;
00021     long now = getMsec();
00022     this.time = now;
00023     return (now-then);    
00024   }
00025   public String toString()
00026   {
00027     return getInterval()+"";
00028   }
00029 }