OCaml bindings to the GETRUSAGE(2) syscall, which provides details of the resource usage of a thread.
GETRUSAGE(2)
rusage
Rusage can be installed with opam:
Rusage
opam
opam install rusage