src/Pure/ML-Systems/smlnj-interrupt-timeout.ML
author krauss
Tue, 06 Jun 2006 09:28:24 +0200
changeset 19782 48c4632e2c28
parent 18790 418131f631fc
permissions -rw-r--r--
HOL/Tools/function_package: imporoved handling of guards, added an example

(*  Title:      Pure/ML-Systems/smlnj-interrupt-timeout.ML
    ID:         $Id$
    Author:     Tjark Weber, Makarius
    Copyright   2006

Bounded time execution (similar to SML/NJ's TimeLimit structure).
*)

fun interrupt_timeout time f x =
  TimeLimit.timeLimit time f x
    handle TimeLimit.TimeOut => raise Interrupt;