Pages

Friday, October 16, 2009

Java : Time elapsed counter using swing

Java program that calculates time elapsed from start time, using this you can implement stop watch. Logic is simple just get start time (time when program started) and increment the time counter by current time minus start time ie (elapsedTime = currentTime - starTime).

Here is the complete tested code, directly you can run this code and see output.