File: update_time.ml

package info (click to toggle)
ocaml-luv 0.5.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,504 kB
  • sloc: ml: 11,130; makefile: 6,223; sh: 4,592; ansic: 1,517; python: 38
file content (10 lines) | stat: -rw-r--r-- 295 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
let () =
  Helpers.with_loop @@ fun loop ->
  let initial = Luv.Loop.now loop in
  Unix.sleepf 0.1;
  Luv.Loop.update_time loop;
  let final = Luv.Loop.now loop in
  if Unsigned.UInt64.(to_int (sub final initial)) >= 100 then
    print_endline "Ok"
  else
    print_endline "Error: not updated"