Author |
Message |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Jun 23, 2005 12:30 pm Post maybe stupid Post subject: Function Timing in Java |
 |
|
|
|
OK, my attempt to hijack Cyhper's Thread failed, so I'll just have to make a new topic.
What I want to do is function timing. Although Cerium's method may work as a last resort, currentTimeMillis() won't be exact at all, and the results will be pretty skewed. Anyway, I need the function to actually run once like normal since it's going to be a networking test. I don't want to do any simulated packets or anything, because the test needs to be as close to real life as possible.
So, is there anything like profiling in Java that wouldn't require me modifying the code beyond the point that it becomes practically useless? _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Jun 23, 2005 12:49 pm Post maybe stupid Post subject: |
 |
|
|
|
A quick google search (for "Java Profiler") revealed: http://ejp.sourceforge.net/ _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
Cerium Server Help Squatter

Age:43 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Thu Jun 23, 2005 1:34 pm Post maybe stupid Post subject: |
 |
|
|
|
JProfiler is great to have regardless.
The CPU view may be exactly what youre looking for (plus the graphs are pretty). The only downside, is it only displays the total runtime for a specific function across all of the times its used, so youd have to make sure your function is only called once, or just do the math yourself. _________________ There are 7 user(s) ignoring me right now. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Mon Jun 27, 2005 9:33 pm Post maybe stupid Post subject: |
 |
|
|
|
OK, this'll work fine. Thanks, Brain.
I didn't just blindly search Google because I knew a few of you are Java programmers and might have a specific recommendation. |
|
Back to top |
|
 |
|