| | |
How to get total time of running program
![]() |
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 |
actuate add android api applet application applications array arrays automation balls bank binary bluetooth business chat class clear client code codesnippet collections component database defaultmethod development dice digit dragging ebook eclipse equation error event formatingtextintooltipjava fractal functiontesting game givemetehcodez graphics gui health hql html hyper ide idea image infinite int integer invokingapacheantprogrammatically j2me java javame javaprojects jni jpanel julia linux list main map method methods mobile myregfun mysql netbeans nonstatic openjavafx parameter pearl php problem program project recursion repositories scanner scrollbar server set sms sort sorting spamblocker sql sqlserver state storm string sun superclass swing swt thread threads tree windows






