Improved usage of Time.now and pbGetTimeNow

This commit is contained in:
Maruno17
2023-05-17 19:24:38 +01:00
parent 28a2b7c9c1
commit 62e372f4d7
14 changed files with 49 additions and 52 deletions

View File

@@ -144,14 +144,14 @@ class File
# Copies the source file to the destination path.
def self.copy(source, destination)
data = ""
t = Time.now
t = System.uptime
File.open(source, "rb") do |f|
loop do
r = f.read(4096)
break if !r
if Time.now - t > 1
if System.uptime - t >= 5
t += 5
Graphics.update
t = Time.now
end
data += r
end