src/Pure/General/timing.scala
author wenzelm
Sat, 13 Nov 2010 19:21:53 +0100
changeset 40523 1050315f6ee2
parent 40393 2bb7ec08574a
child 40848 8662b9b1f123
permissions -rw-r--r--
simplified/robustified treatment of malformed symbols, which are now fully internalized (total Symbol.explode etc.); allow malformed symbols inside quoted material, comments etc. -- for improved user experience with incremental re-parsing; refined treatment of malformed surrogates (Scala);

/*  Title:      Pure/General/timing.scala
    Author:     Makarius

Basic support for time measurement.
*/

package isabelle


sealed case class Timing(val elapsed: Double, cpu: Double, gc: Double)
{
  private def print_time(seconds: Double): String =
    String.format(java.util.Locale.ROOT, "%.3f", seconds.asInstanceOf[AnyRef])

  def message: String =
    print_time(elapsed) + "s elapsed time, " +
    print_time(cpu) + "s cpu time, " +
    print_time(gc) + "s GC time"
}