Trash Talk - Function Timing in Java Cyan~Fire - Thu Jun 23, 2005 12:30 pm 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?
Dr Brain - Thu Jun 23, 2005 12:49 pm Post subject:
A quick google search (for "Java Profiler") revealed: http://ejp.sourceforge.net/Cerium - Thu Jun 23, 2005 1:34 pm 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.
Cyan~Fire - Mon Jun 27, 2005 9:33 pm 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.