* Pupose: to create a class which interacts with the StopWatch GUI
*/
public class Timer {
private long startTime; //stores the starting time
private long endTime; //stores the ending time
//setter method for the starting time
public void setStartTime(long startTime) {
this.startTime = startTime;
}//end setStartTime
//setter method for the stopping time
public void setEndTime(long endTime) {
this.endTime = endTime;
}//end setEndTime
//returns the difference between the starting time and the ending time
public double getElapsedTime(){
double elapsedTime = (double)((int)((endTime - startTime)/100))/10;
return(elapsedTime);
}//end getElapsedTime
}//end Timer
Published by Chris Chen
Chris is currently attending the University of California, Berkeley seeking an undergraduate's degree in Electrical Engineering Computer Science. He enjoys playing basketball, practicing kendo, hanging out w... View profile
- How Public Speaking Skills Can Help You Get Ahead in a Tough EconomyAndrea Flowers, a college instructor in communications and public speaking, discusses how public speaking skills can help you in everyday life.
- Be the Gangster John Dillinger for Halloween; See How to Match Johnny Depp's Costu...A breakdown of Johnny Depp's gangster costume as John Dillinger in Public Enemies so that you can become John Dillinger, Public Enemy #1 for Halloween.
- Why I Love Open Source SoftwareWhy open source software like Drupal and WordPress make sense.
- Going Beyond the Code: Doom Source Ports1993 was the turn of the video game industry. It was when a few genius people created a little game called "Doom" and it changed the world. In 1997, the creators released the source code to the game and many source po...
- The Ultimate Source of Spam and How to Avoid ItThe greatest source of all internet spam has been determined. Find out what it is, and defend yourself from email spam!
- Casio G-shock GW500A1-V Wrist Watch Review
- Citizen Skyhawk Eco-Drive JR 3090 58J Wrist Watch
- School Bus Stop Abductions: It Happens
- Congress Panel Hears Testimony Regarding Warrantless Wire Tapping Program
- One Dollar, One Shelter, One Month Program Helps Fund Animal Shelters
- Mizzou's Unique Journalism Program Offers More Than Your Average Media Studies
- Class Assignment



