From ebd3a6804d3aa067df3fad0eae4006536cdd5d6e Mon Sep 17 00:00:00 2001 From: Firew0lf Date: Wed, 19 Aug 2015 21:19:59 +0200 Subject: [PATCH] Added "ctr.time()", with millisecond precision --- source/ctr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/ctr.c b/source/ctr.c index c2cbfac..b3ca2dd 100644 --- a/source/ctr.c +++ b/source/ctr.c @@ -1,3 +1,6 @@ +#include <3ds/types.h> +#include <3ds/os.h> + #include #include @@ -7,8 +10,15 @@ int load_news_lib(lua_State *L); int load_ptm_lib(lua_State *L); int load_hid_lib(lua_State *L); +static int ctr_time(lua_State *L) { + lua_pushinteger(L, osGetTime()); + + return 1; +} + // Functions static const struct luaL_Reg ctr_lib[] = { + { "time", ctr_time}, { NULL, NULL } };