File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 2929function BenchmarkEnd (start_time )
3030 local t = os.clock () - start_time
3131 local m , s = math.floor (t / 60 ), (t % 60 )
32- io.write (string.format (" %6d:%010.7f \n " , m , s ))
32+ io.write (string.format (" %7d:%09.6f \n " , m , s ))
3333end
3434
3535local function benchmark_pi ()
146146-- Some information
147147print (" Interpreter:" , _VERSION )
148148print (" System Family:" , SystemFamily ())
149- print (" Memory (KB) :" , collectgarbage (" count" ))
149+ print (" Memory Used :" , string.format ( " %.3fkB " , collectgarbage (" count" ) ))
150150print (" Minimum Int:" , math.mininteger or " Unknown" )
151151print (" Maximum Int:" , math.maxinteger or " Unknown" )
152152print ()
@@ -165,8 +165,6 @@ benchmark_pi()
165165benchmark_gcd ()
166166
167167benchmark_array ()
168-
169- print ()
170- print (" Total memory usage (KB):" , collectgarbage (" count" ))
171- io.write (" Total benchmark seconds:\t " )
168+ print (string.rep (' _' , 49 ))
169+ io.write (" Total:\t\t " .. string.format (" %8.3fkB" , collectgarbage (" count" )) .. " \t " )
172170BenchmarkEnd (bm )
You can’t perform that action at this time.
0 commit comments