blob: c9f558dbc09665ba1cc2b12a5a729c5982204bce (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
discard """
cmd: "nim $target --debuginfo $options $file"
output: "Done"
"""
import times, os, threadpool
const RUNTIME = 15 * 60 # 15 minutes
when defined(windows):
const dllname = "./tests/realtimeGC/shared.dll"
elif defined(macosx):
const dllname = "./tests/realtimeGC/libshared.dylib"
else:
const dllname = "./tests/realtimeGC/libshared.so"
proc status() {.importc: "status", dynlib: dllname.}
proc count() {.importc: "count", dynlib: dllname.}
proc checkOccupiedMem() {.importc: "checkOccupiedMem", dynlib: dllname.}
proc process() =
let startTime = getTime()
let runTime = cast[Time](RUNTIME) #
var accumTime: Time
while accumTime < runTime:
for i in 0..10:
count()
# echo("1. sleeping... ")
sleep(500)
for i in 0..10:
status()
# echo("2. sleeping... ")
sleep(500)
checkOccupiedMem()
accumTime = cast[Time]((getTime() - startTime))
# echo("--- Minutes left to run: ", int(int(runTime-accumTime)/60))
proc main() =
process()
# parallel:
# for i in 0..0:
# spawn process()
# sync()
echo("Done")
main()
|