| | |
How to get total time of running program
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
1) we don't do your homework for you, show some effort
2) we're certainly not going to let you order us around to do it "asap". If and when we do anything it'll be at a time and place of our choosing, not yours, suggesting anything else makes us LESS eager to help you.
3) (general warning) it's NOT "urgent" to anyone except possibly you, and if it is you should have started sooner.
4) properly define your problem domain. WHAT do you want to measure exactly? What that is defines where and how to measure it.
2) we're certainly not going to let you order us around to do it "asap". If and when we do anything it'll be at a time and place of our choosing, not yours, suggesting anything else makes us LESS eager to help you.
3) (general warning) it's NOT "urgent" to anyone except possibly you, and if it is you should have started sooner.
4) properly define your problem domain. WHAT do you want to measure exactly? What that is defines where and how to measure it.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
•
•
Join Date: Oct 2007
Posts: 39
Reputation:
Solved Threads: 0
can someone teach me how to get the running time of this program? thank you very much!
Java Syntax (Toggle Plain Text)
import java.io.*; public class ArrauSample { public static void main(String args[]){ BufferedReader console = new BufferedReader(new InputStreamReader(System.in)); int x=0; int max= 5; int myNum[] = new int[max]; String myString[] = new String[max]; try{ for(x=0; x<max; x++) { System.out.println("Input element #" + (x+1)); myString[x]=console.readLine(); } }catch(IOException e){} for(x=0; x<max; x++) { System.out.print("Element #" + (x+1)); System.out.println(myString[x]); } } }
•
•
Join Date: Oct 2007
Posts: 55
Reputation:
Solved Threads: 5
Well the basic way of getting time in a program is to use
long x = System.getCurrentTime();
which returns the current time of the computer in milliseconds.
Anyone with a brain could figure it out from there! :p
long x = System.getCurrentTime();
which returns the current time of the computer in milliseconds.
Anyone with a brain could figure it out from there! :p
•
•
Join Date: Nov 2006
Posts: 224
Reputation:
Solved Threads: 31
•
•
•
•
Well the basic way of getting time in a program is to use
long x = System.getCurrentTime();
which returns the current time of the computer in milliseconds.
Anyone with a brain could figure it out from there! :p
perhaps you are thinking of System.currentTimeMillis()
--
Index of mp3
Index of mp3
![]() |
Similar Threads
- Get video file total time of playing using php (PHP)
- Time display program (C++)
- Running a program (C++)
- Help with a Time Keeping Program (Computer Science)
Other Threads in the Java Forum
- Previous Thread: query
- Next Thread: j2me textfield password
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception file fractal ftp game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited variablebinding webservices windows






