From a9459bc7233e92a6516c3fbc8a18a9d33966e244 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 2 Feb 2014 00:57:06 +0200 Subject: unix: Add basic time module (with time() and clock() functions). Both return int so far (single-precision float doesn't have enough bits to represent int32 precisely). --- unix/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'unix/main.c') diff --git a/unix/main.c b/unix/main.c index 5ca8115368..cc942163f9 100644 --- a/unix/main.c +++ b/unix/main.c @@ -24,6 +24,7 @@ extern const mp_obj_fun_native_t mp_builtin_open_obj; void file_init(); void rawsocket_init(); +void time_init(); void ffi_init(); static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind, bool is_repl) { @@ -242,6 +243,9 @@ int main(int argc, char **argv) { file_init(); rawsocket_init(); +#if MICROPY_MOD_TIME + time_init(); +#endif #if MICROPY_MOD_FFI ffi_init(); #endif -- cgit v1.2.3