Skip to content

Commit e35dd1d

Browse files
author
hartsantler
committed
lua.js: fixed typo in os.clock, and made os.time return floating point number.
1 parent 0d637bf commit e35dd1d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

external/lua.js/lua.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ lua_libs["os"] = {
988988
"clock": function () {
989989
// This function is supposed to return the time the script has been executing
990990
// not the time since it started, but I don't know of a way to do this.
991-
return [(((new Date()).getTime()) / 1000) - _lua_clock_script];
991+
return [(((new Date()).getTime()) / 1000) - _lua_clock_start];
992992
},
993993
"date": function (format, time) {
994994
// TODO
@@ -1020,7 +1020,7 @@ lua_libs["os"] = {
10201020
if (table) {
10211021
not_supported();
10221022
} else {
1023-
return [Math.floor(new Date().getTime() / 1000)];
1023+
return [new Date().getTime() / 1000];
10241024
}
10251025
}
10261026
};

0 commit comments

Comments
 (0)