mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
Attempt to fix
This commit is contained in:
parent
7d9eac5584
commit
211b81fdd0
@ -47,11 +47,14 @@ local stats = {
|
||||
}
|
||||
|
||||
local function doSleep()
|
||||
|
||||
local epsilon = 1e-6
|
||||
local deadline = computer.uptime() + (tonumber(options.i) or tonumber(options.interval) or 1)
|
||||
repeat
|
||||
event.pull(deadline - computer.uptime())
|
||||
until computer.uptime() >= deadline
|
||||
local remaining = deadline - computer.uptime()
|
||||
if remaining <= epsilon then break end
|
||||
|
||||
event.pull(math.max(remaining, 0.001))
|
||||
until computer.uptime() >= deadline - epsilon
|
||||
end
|
||||
|
||||
local function doPing()
|
||||
|
@ -25,9 +25,13 @@ end
|
||||
function os.sleep(timeout)
|
||||
checkArg(1, timeout, "number", "nil")
|
||||
local deadline = computer.uptime() + (timeout or 0)
|
||||
local epsilon = 1e-6
|
||||
repeat
|
||||
event.pull(deadline - computer.uptime())
|
||||
until computer.uptime() >= deadline
|
||||
local remaining = deadline - computer.uptime()
|
||||
if remaining <= epsilon then break end
|
||||
|
||||
event.pull(math.max(remaining, 0.001))
|
||||
until computer.uptime() >= deadline - epsilon
|
||||
end
|
||||
|
||||
os.setenv("PATH", "/bin:/usr/bin:/home/bin:.")
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user