Module id.xfunction
Package id.xfunction

Class Microprofiler

Object
Microprofiler

public class Microprofiler extends Object
Measures different execution time of functions.
  • Constructor Details

    • Microprofiler

      public Microprofiler()
  • Method Details

    • measureUserCpuTime

      public long measureUserCpuTime(Runnable r)
      Measures real CPU execution time in milliseconds.
      Returns:
      real CPU execution time in milliseconds or -1 if it is not possible to calculate
    • measureRealTime

      public long measureRealTime(Runnable r)
      Measures execution time in milliseconds using wall clock. It is not precise time since CPU may perform context switch to another thread but the clock will still be ticking.
    • measureExecutionTime

      public long measureExecutionTime(Runnable r)
      Chooses the best available on current JVM way to measure the execution time and returns it in milliseconds.
    • gcCount

      public static long gcCount()