12345678910111213141516171819202122(*---------------------------------------------------------------------------
Copyright (c) 2015 The mtime programmers. All rights reserved.
Copyright (c) 2026 Invariant Systems. All rights reserved.
SPDX-License-Identifier: ISC
---------------------------------------------------------------------------*)externalelapsed_ns:unit->int64="ocaml_windtrap_clock_elapsed_ns"(* Force a call at module load time to initialize the C-side clock origin. *)let()=ignore(elapsed_ns())typecounter=int64letcounter()=elapsed_ns()letcountstart=letnow=elapsed_ns()inInt64.subnowstartletcount_sstart=letns=countstartinInt64.to_floatns/.1_000_000_000.