| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | let read_counter : unit -> (Int64.t, string) Result.t = |
| 12 | let drop () = try Perf.drop () with Failure(_) -> () in |
| 13 | try |
| 14 | Perf.init (); at_exit drop; |
| 15 | fun () -> try Ok(Perf.peek ()) with Failure(msg) -> Error(msg) |
| 16 | with Failure(msg) -> |
| 17 | fun () -> Error(msg) |