Advertisement
Rochet2

luamemory in bytes and kilobytes

Jul 11th, 2014
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. local k, b = collectgarbage("count")
  2. print(k, b)
  3.  
  4. local kb_to_b = math.floor(k) * 1024
  5. local dec_to_b = (k-math.floor(k)) * 1024
  6. local sum = kb_to_b + dec_to_b
  7. print("bytes:", sum)
  8. print("kilobytes:", (sum)*(1/1024))
  9.  
  10. local justb = k * 1024
  11. print("bytes:", justb)
  12. print("kilobytes:", (justb)*(1/1024))
  13.  
  14. print("Foe:", (collectgarbage("count") * 1024)/1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement