lua get system uptime(seconds)

lua get system uptime(seconds)

local posix = require("posix")

function uptime_sec()
	local timesec = posix.clock_gettime(1)
	if timesec then
		return tonumber(timesec["tv_sec"])
	end
	return 0
end

Comments

Popular posts from this blog

Python Receiving and parse JSON Data via UDP protocol

ubus lua client method and event registration code demo/example