1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-27 16:39:29 +00:00

Added "ctr.time()", with millisecond precision

This commit is contained in:
Firew0lf 2015-08-19 21:19:59 +02:00
parent 589d7a68a8
commit ebd3a6804d

View file

@ -1,3 +1,6 @@
#include <3ds/types.h>
#include <3ds/os.h>
#include <lua.h> #include <lua.h>
#include <lauxlib.h> #include <lauxlib.h>
@ -7,8 +10,15 @@ int load_news_lib(lua_State *L);
int load_ptm_lib(lua_State *L); int load_ptm_lib(lua_State *L);
int load_hid_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 // Functions
static const struct luaL_Reg ctr_lib[] = { static const struct luaL_Reg ctr_lib[] = {
{ "time", ctr_time},
{ NULL, NULL } { NULL, NULL }
}; };