Lua function to get system time in milliseconds