author | wenzelm |
Sat, 06 Nov 2010 17:55:32 +0100 | |
changeset 40393 | 2bb7ec08574a |
child 40848 | 8662b9b1f123 |
permissions | -rw-r--r-- |
40393 | 1 |
/* Title: Pure/General/timing.scala |
2 |
Author: Makarius |
|
3 |
||
4 |
Basic support for time measurement. |
|
5 |
*/ |
|
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
10 |
sealed case class Timing(val elapsed: Double, cpu: Double, gc: Double) |
|
11 |
{ |
|
12 |
private def print_time(seconds: Double): String = |
|
13 |
String.format(java.util.Locale.ROOT, "%.3f", seconds.asInstanceOf[AnyRef]) |
|
14 |
||
15 |
def message: String = |
|
16 |
print_time(elapsed) + "s elapsed time, " + |
|
17 |
print_time(cpu) + "s cpu time, " + |
|
18 |
print_time(gc) + "s GC time" |
|
19 |
} |
|
20 |