diff options
-rw-r--r-- | src/loslib.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/loslib.js b/src/loslib.js index 4d549b6..4b147cf 100644 --- a/src/loslib.js +++ b/src/loslib.js @@ -157,8 +157,13 @@ const syslib = { "time": os_time }; -// Only with Node -if (!WEB) { +if (WEB) { + syslib.clock = function(L) { + lua.lua_pushnumber(L, performance.now()/1000); + return 1; + }; +} else { + /* Only with Node */ const fs = require('fs'); const tmp = require('tmp'); const child_process = require('child_process'); |