Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 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()
  8.     {
  9.        
  10.     }
  11.    
  12.     //Method Section
  13.     public long timeStarted()
  14.     {
  15.         long timeStarted = this.timeStart;
  16.         return timeStarted;
  17.     }
  18.  
  19.     public long elapsedTime()
  20.     {
  21.         long currentTime = java.lang.System.currentTimeMillis();
  22.         long elapsedTime = currentTime - timeStarted();
  23.         return elapsedTime;
  24.        
  25.  
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement