diff options
Diffstat (limited to 'src/nbc/stopwatch.sml')
-rw-r--r-- | src/nbc/stopwatch.sml | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/nbc/stopwatch.sml b/src/nbc/stopwatch.sml deleted file mode 100644 index 43547ed..0000000 --- a/src/nbc/stopwatch.sml +++ /dev/null @@ -1,24 +0,0 @@ -signature STOPWATCH = sig - exception FinishWithoutStart - val start: string -> unit - val finish: unit -> unit -end -structure Stopwatch :> STOPWATCH = struct - exception FinishWithoutStart - local - val time = ref NONE - in - fun start doing = ( - print (concat [doing, "..."]) - ; time := SOME (Time.now ()) - ) - fun finish () = case !time of - SOME t => ( - print (concat [ - " done in " - , Time.toString (Time.- (Time.now (), t)) - , " seconds.\n" - ]); time := NONE - ) | NONE => raise FinishWithoutStart - end -end |