D
Drew
Hi All:
I have an existing Java application which works fine. I want to add
some code to the application just to calculate the run time of the
program.
Its a Java Console program.
So, at the very start of the program, I want to get the current
date/time and store it in a variable.
Then, at the very last line of the program, I will again get the
current data/time and store it in a variable.
What's the best way to get the current date/time in Java and what's
the easiest way to find the difference in time in the two dates?
My existing application may sometimes take a few seconds and other
times runs in less than a second. So, my output probably needs to go
down to the millisecond level.
Any help is much appreciated!
Thanks!
Drew
I have an existing Java application which works fine. I want to add
some code to the application just to calculate the run time of the
program.
Its a Java Console program.
So, at the very start of the program, I want to get the current
date/time and store it in a variable.
Then, at the very last line of the program, I will again get the
current data/time and store it in a variable.
What's the best way to get the current date/time in Java and what's
the easiest way to find the difference in time in the two dates?
My existing application may sometimes take a few seconds and other
times runs in less than a second. So, my output probably needs to go
down to the millisecond level.
Any help is much appreciated!
Thanks!
Drew