SizeOf-like approach to time-profiling?

B W
2008-01-23
2013-04-25
  • B W

    B W - 2008-01-23

    Hi, thanks for making SizeOf - it's really helped me with profiling memory use.
    Now I'm trying to find something similar for time profiling, where I could replace code like

    long startTime = System.currentTimeMillis();
    doSomething();
    long totalTime = System.currentTimeMillis() - startTime;
    System.out.println("Duration: " + totalTime);

    With something like

    long startTime = TimingAPI.time();
    doSomething();
    long totalTime = TimingAPI.time() - startTime;
    System.out.println("Duration: " + totalTime);

    where the TimingAPI would use the java instrumentation api to give me the exact number of JVM clock cycles that doSomething() used. This way I wouldn't have to worry about other threads and processes interrupting doSomething() and screwing up the System.currentTimeMillis() measurement.

    Do you know of something that does this? If not, would you be willing to work together to create this?

    Thanks
    -Ben

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks