diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/check-memory.lua | 17 | ||||
-rw-r--r-- | etc/get.lua | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/etc/check-memory.lua b/etc/check-memory.lua new file mode 100644 index 0000000..fdc6b9b --- /dev/null +++ b/etc/check-memory.lua | |||
@@ -0,0 +1,17 @@ | |||
1 | function load(s) | ||
2 | collectgarbage() | ||
3 | local a = gcinfo() | ||
4 | _G[s] = require(s) | ||
5 | collectgarbage() | ||
6 | local b = gcinfo() | ||
7 | print(s .. ":\t " .. (b-a) .. "k") | ||
8 | end | ||
9 | |||
10 | load("socket") | ||
11 | load("url") | ||
12 | load("ltn12") | ||
13 | load("mime") | ||
14 | load("tp") | ||
15 | load("smtp") | ||
16 | load("http") | ||
17 | load("ftp") | ||
diff --git a/etc/get.lua b/etc/get.lua index c1e0542..0603ce5 100644 --- a/etc/get.lua +++ b/etc/get.lua | |||
@@ -8,6 +8,7 @@ socket = require("socket") | |||
8 | http = require("http") | 8 | http = require("http") |
9 | ftp = require("ftp") | 9 | ftp = require("ftp") |
10 | url = require("url") | 10 | url = require("url") |
11 | ltn12 = require("ltn12") | ||
11 | 12 | ||
12 | -- formats a number of seconds into human readable form | 13 | -- formats a number of seconds into human readable form |
13 | function nicetime(s) | 14 | function nicetime(s) |