Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. public class StopWatch {
  2.    
  3.     //Attribute Section
  4.     private long timeStart = java.lang.System.currentTimeMillis();
  5.    
  6.     //Constructor Section
  7.     public StopWatch(long start)
  8.     {
  9.         this.timeStart = start;
  10.        
  11.     }
  12.    
  13.     //Method Section
  14.     public long timeStarted()
  15.     {
  16.         long timeStarted = this.timeStart;
  17.         return timeStarted;
  18.     }
  19.  
  20.     public long elapsedTime()
  21.     {
  22.         long currentTime = java.lang.System.currentTimeMillis();
  23.         long elapsedTime = 0;
  24.         elapsedTime = currentTime - timeStarted();
  25.         return elapsedTime;
  26.        
  27.  
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement