1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556(******************************************************************************)(* *)(* Alt-Ergo: The SMT Solver For Software Verification *)(* Copyright (C) 2013-2018 --- OCamlPro SAS *)(* *)(* This file is distributed under the terms of the license indicated *)(* in the file 'License.OCamlPro'. If 'License.OCamlPro' is not *)(* present, please contact us to clarify licensing. *)(* *)(******************************************************************************)(** TODO: use the newly available Sys.backend_type to simplify things ? *)moduleDefault_Unix=structopenUnixletcur_time()=(times()).tms_utimeletset_timeout~is_guitimelimit=ifPervasives.(<>)timelimit0.thenletitimer=ifis_guithenUnix.ITIMER_REAL(* troubles with VIRTUAL *)elseUnix.ITIMER_VIRTUALinignore(Unix.setitimeritimer{Unix.it_value=timelimit;Unix.it_interval=0.})letunset_timeout~is_gui=letitimer=ifis_guithenUnix.ITIMER_REAL(* troubles with VIRTUAL *)elseUnix.ITIMER_VIRTUALinignore(Unix.setitimeritimer{Unix.it_value=0.;Unix.it_interval=0.})endincludeDefault_Unix(* !! This commented code is used when compiling to javascript !!
module JavaScript_Unix = struct
let cur_time () =
let today = jsnew Js.date_now () in
let t = Js.to_float (today##getTime()) in
t /. 1000.
let set_timeout _ = ()
let unset_timeout () = ()
end
include JavaScript_Unix
*)