Air202 - 命令 writetxt(f,v) 的内存写入周期数是多少?

欢迎您!
关于通过命令将当前时间戳写入内存的问题。

Hello!
Question about writing the current time stamp to memory by command.

writetxt(f,v)

脚本
Script.

module(...,package.seeall)

local function print(...)
_G.print("test",...)
end

require"misc"

f = "/file.txt"
v = os.time()

local function writeTime()
writetxt(f,v)
end
sys.timer_start(writeTime,30000)

local function readTime()
print(readtxt(f))
end
sys.timer_start(readTime,40000)


function writetxt(f,v)
local file = io.open(f,"w")
if not file then print("sys.writetxt no open",f) return end
file:write(v)
file:close()
end

function readtxt(f)
local file,rt = io.open(f,"r")
if not file then print("sys.readtxt no open",f) return "" end
rt = file:read("*a")
file:close()
return rt
end


内存在当前时间戳的写周期数上的持久性是多少?
我可以在非易失性存储器中保存多少次当前时间戳?
感谢您提供的信息。

What is the durability of memory on the number of write cycles of the current timestamp?
How many times can I save the current timestamp in nonvolatile memory?
Thank you for the information provided.


请先 登录 后评论

最佳答案 2019-03-11 16:04

请参考http://ask.openluat.com/question/1694的回答,这两种方式都是存储到文件系统,性能参数是一样的

请先 登录 后评论

其它 0 个回答