{"action":"created","issue":{"url":"https://api.github.com/repos/mirage/mirage/issues/547","repository_url":"https://api.github.com/repos/mirage/mirage","labels_url":"https://api.github.com/repos/mirage/mirage/issues/547/labels{/name}","comments_url":"https://api.github.com/repos/mirage/mirage/issues/547/comments","events_url":"https://api.github.com/repos/mirage/mirage/issues/547/events","html_url":"https://github.com/mirage/mirage/pull/547","id":160780745,"number":547,"title":"TIME: use an int64 for sleep","user":{"login":"hannesm","id":228456,"avatar_url":"https://avatars.githubusercontent.com/u/228456?v=3","gravatar_id":"","url":"https://api.github.com/users/hannesm","html_url":"https://github.com/hannesm","followers_url":"https://api.github.com/users/hannesm/followers","following_url":"https://api.github.com/users/hannesm/following{/other_user}","gists_url":"https://api.github.com/users/hannesm/gists{/gist_id}","starred_url":"https://api.github.com/users/hannesm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannesm/subscriptions","organizations_url":"https://api.github.com/users/hannesm/orgs","repos_url":"https://api.github.com/users/hannesm/repos","events_url":"https://api.github.com/users/hannesm/events{/privacy}","received_events_url":"https://api.github.com/users/hannesm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mirage/mirage/labels/breaks%20compatibility","name":"breaks compatibility","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-06-16T23:08:33Z","updated_at":"2016-06-17T14:16:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mirage/mirage/pulls/547","html_url":"https://github.com/mirage/mirage/pull/547","diff_url":"https://github.com/mirage/mirage/pull/547.diff","patch_url":"https://github.com/mirage/mirage/pull/547.patch"},"body":"I got derailed while wanting to adapt the RANDOM module type with the TIME module type.\r\n\r\nIts documentation:\r\n```OCaml\r\n  val sleep: float -> unit io\r\n  (** [sleep nsec] Block the current thread for. {b FIXME:} remove float. *)\r\n```\r\n\r\nI propose to have: `val sleep : Int64 -> unit io`, the amount of nanoseconds (this is what we get out of the monotonic clock on [xen](https://github.com/mirage/mirage-platform/blob/ed19a1a318e944a7020239fa01c0b674b02cf471/bindings/clock_stubs.c#L39), and likely as well from Lwt_unix.sleep.  The range will be up to 9223372036854775807L nanoseconds (106751 days).\r\n\r\nI've patchsets for (compiles + test run with 4.03 on Unix (FreeBSD)):\r\n- [mirage-types](https://github.com/hannesm/mirage/tree/sleep-nsec)\r\n- [mirage-platform](https://github.com/hannesm/mirage-platform/tree/sleep-nsec)\r\n- [dns](https://github.com/hannesm/ocaml-dns/tree/sleep-nsec)\r\n- [tcpip](https://github.com/hannesm/mirage-tcpip/tree/sleep-nsec)\r\n- [mirage-skeleton](https://github.com/hannesm/mirage-skeleton/tree/sleep-nsec)\r\n\r\nanyone aware of other users of (OS.)Time.sleep (our website tutorial for sure)?  Any comments on this proposed API change?"},"comment":{"url":"https://api.github.com/repos/mirage/mirage/issues/comments/226780492","html_url":"https://github.com/mirage/mirage/pull/547#issuecomment-226780492","issue_url":"https://api.github.com/repos/mirage/mirage/issues/547","id":226780492,"user":{"login":"hannesm","id":228456,"avatar_url":"https://avatars.githubusercontent.com/u/228456?v=3","gravatar_id":"","url":"https://api.github.com/users/hannesm","html_url":"https://github.com/hannesm","followers_url":"https://api.github.com/users/hannesm/followers","following_url":"https://api.github.com/users/hannesm/following{/other_user}","gists_url":"https://api.github.com/users/hannesm/gists{/gist_id}","starred_url":"https://api.github.com/users/hannesm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannesm/subscriptions","organizations_url":"https://api.github.com/users/hannesm/orgs","repos_url":"https://api.github.com/users/hannesm/repos","events_url":"https://api.github.com/users/hannesm/events{/privacy}","received_events_url":"https://api.github.com/users/hannesm/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T14:16:10Z","updated_at":"2016-06-17T14:16:10Z","body":"this (and all its dependencies) now has `Time.nanosleep`"}}
{"actor":{"display_login":"hannesm"}}