src/Pure/General/markup.scala
changeset 40394 6dcb6cbf0719
parent 40392 6f47c49fed84
child 40848 8662b9b1f123
--- a/src/Pure/General/markup.scala	Sat Nov 06 17:55:32 2010 +0100
+++ b/src/Pure/General/markup.scala	Sat Nov 06 18:10:35 2010 +0100
@@ -216,6 +216,31 @@
   val MALFORMED_SPAN = "malformed_span"
 
 
+  /* timing */
+
+  val TIMING = "timing"
+  val ELAPSED = "elapsed"
+  val CPU = "cpu"
+  val GC = "gc"
+
+  object Timing
+  {
+    def apply(timing: isabelle.Timing): Markup =
+      Markup(TIMING, List(
+        (ELAPSED, Double(timing.elapsed)),
+        (CPU, Double(timing.cpu)),
+        (GC, Double(timing.gc))))
+    def unapply(markup: Markup): Option[isabelle.Timing] =
+      markup match {
+        case Markup(TIMING, List(
+          (ELAPSED, Double(elapsed)),
+          (CPU, Double(cpu)),
+          (GC, Double(gc)))) => Some(isabelle.Timing(elapsed, cpu, gc))
+        case _ => None
+      }
+  }
+
+
   /* toplevel */
 
   val SUBGOALS = "subgoals"