-- 设置动态库路径
package.cpath = './luaclib/?.so;'
 
-- 加载socket
local socket = require('socket.core')
 
-- 获取当前毫秒时间
local current = socket.gettime() * 1000
 
print(string.format('current time is %d ',current))

Lua 获取毫秒精度时间

 

socket.tgz  可以自己安装

 

相关文章: