src/Pure/ML-Systems/ml_profiling_polyml.ML
author haftmann
Mon, 07 Dec 2015 10:49:08 +0100
changeset 61823 5daa82ba4078
parent 61715 5dc95d957569
child 61885 acdfc76a6c33
permissions -rw-r--r--
clarified terminology

(*  Title:      Pure/ML-Systems/ml_profiling_polyml.ML
    Author:     Makarius

Profiling for Poly/ML.
*)

fun profile 0 f x = f x
  | profile n f x =
      let
        val _ = RunCall.run_call1 RuntimeCalls.POLY_SYS_profiler n;
        val res = Exn.capture f x;
        val _ = RunCall.run_call1 RuntimeCalls.POLY_SYS_profiler 0;
      in Exn.release res end;