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:
parent
589d7a68a8
commit
ebd3a6804d
1 changed files with 10 additions and 0 deletions
10
source/ctr.c
10
source/ctr.c
|
|
@ -1,3 +1,6 @@
|
|||
#include <3ds/types.h>
|
||||
#include <3ds/os.h>
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
||||
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue