mirror of
https://github.com/danog/ir.git
synced 2025-01-22 13:41:11 +01:00
Add os.clock() function
This commit is contained in:
parent
1b4f83ef7e
commit
10dc034ff4
@ -6985,9 +6985,14 @@ return os_pushresult(L,remove(filename)==0,filename);
|
||||
static int os_exit(lua_State*L){
|
||||
exit(luaL_optint(L,1,EXIT_SUCCESS));
|
||||
}
|
||||
static int os_clock(lua_State*L){
|
||||
lua_pushnumber(L,((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC);
|
||||
return 1;
|
||||
}
|
||||
static const luaL_Reg syslib[]={
|
||||
{"exit",os_exit},
|
||||
{"remove",os_remove},
|
||||
{"clock",os_clock},
|
||||
{NULL,NULL}
|
||||
};
|
||||
static int luaopen_os(lua_State*L){
|
||||
|
Loading…
x
Reference in New Issue
Block a user