Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StopWatch {
- //Attribute Section
- private long timeStart = java.lang.System.currentTimeMillis();
- //Constructor Section
- public StopWatch(long start)
- {
- this.timeStart = start;
- }
- //Method Section
- public long timeStarted()
- {
- long timeStarted = this.timeStart;
- return timeStarted;
- }
- public long elapsedTime()
- {
- long currentTime = java.lang.System.currentTimeMillis();
- long elapsedTime = 0;
- elapsedTime = currentTime - timeStarted();
- return elapsedTime;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement