lib: move nanosleep from curses to time
[nit.git] / lib / standard / time.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2008 Floréal Morandat <morandat@lirmm.fr>
4 #
5 # This file is free software, which comes along with NIT. This software is
6 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7 # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8 # PARTICULAR PURPOSE. You can modify it is you want, provided this header
9 # is kept unaltered, and a notification of the changes is added.
10 # You are allowed to redistribute it and sell it, alone or is a part of
11 # another product.
12
13 # Management of time and dates
14 package time
15
16 import kernel
17
18 redef class Object
19 # Unix time: the number of seconds elapsed since January 1, 1970
20 protected fun get_time: Int is extern "kernel_Any_Any_get_time_0"
21 end
22
23 redef class Sys
24 # Wait a specific number of second and nanoseconds
25 fun nanosleep(sec, nanosec: Int) is extern "std_nanosleep"
26 end