Re: (timed) java -verbose ... printing nanoseconds when the function
call was made ...
"[no name]" wrote:
Is it possible? Maybe using the OS? (like Solaris DTrace?)
Your post was a bit on the obscure side. Your subject line was highly abbr=
eviated and your question was not explained in the body of the post. I und=
erstood you much better once I read Arne's answer, though. It is considered=
good netiquette to make the body of your post self-contained.
I'm afraid, though, that I am still not entirely clear on your need. When =
you say (only in the subject) "printing nanoseconds when the function [sic]=
call was made", do you want to timestamp the point of the call, measure th=
e duration of the method call, or what?
A quick glance at the documentation (!) for "java -verbose" and other optio=
ns to the "java" command
<http://download.oracle.com/javase/6/docs/technotes/tools/solaris/java.html=
shows that the only option that might have anything to do with timing is
"java -Xprof".
Googling for "java +Xprof timing"
<http://lmgtfy.com/?q=java+%2BXprof+timing>
yields some interesting-looking links. The top one I see is
<http://www.javaperformancetuning.com/news/qotm037.shtml>
which explains the option pretty well, but misspells "its" consistently.
However, <http://www.javaperformancetuning.com/> in general should be a use=
ful site for you if you are trying to tune Java performance.
As Arne points out, nanosecond timing is a bit of a fantasy. Not only will=
you have a hard time finding system timing to that accuracy, anything you =
do to time your Java system will affect the timing. Plus Java is inherentl=
y non-deterministic (discount the specialty real-time Java implementations)=
.. GC and HotSpot both perform differently depending on run-time conditions=
.. Given the vagueness of your initial question, I'm going to suggest that =
you have a lot of work ahead of you to design a rigorous timing approach th=
at will provide any kind of meaningful results.
--
Lew