then compute the time-difference between the 1st timestamp and 2nd timestamp and
put the time-difference value in the textbox
Why program in object-oriented code?
No parameter passing is needed all data variables needed for the computation are self-contained within the time_object.
There is only one global variable used, i.e., time_object, which contains everything you need, from data variables to methods (i.e., functions that operate on their own data within the object).
That is to say, the time_object knows everything it needs to do with its data without outside help.
In fact, no outside help should ever interfere with time_object's internal data manipulation, and should be blocked from doing so.
Otherwise it cannot guarantee the integrity of its internal data if someone dinks around with it.
Can you imagine what it can do to your elapsed time if someone attempts to change this_start_time value accidentally from the outside?
This is why writing in object-oriented code can provide some guarantee of data integrity and security.
Usage:
Click "Start" button to reset and start timing.
Click "Finish" button to display elapsed time.
Click "Finish" button again to display the elapsed time since the last "Start" click, etc.
Click "Start" button to reset the elapsed time to zero.