diff options
| author | ruki <[email protected]> | 2019-12-07 21:14:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-12-07 21:14:25 +0800 |
| commit | fdaddc5793ee13bf78befd08412c3278bd861360 (patch) | |
| tree | bad44a833571c402de68aa2bb3368b9cc1fc2953 /tests/modules/scheduler/test.lua | |
| parent | 80a87e861943cb89f4a191ac62cf3d50ee375ebd (diff) | |
impl runloop for scheduler
Diffstat (limited to 'tests/modules/scheduler/test.lua')
| -rw-r--r-- | tests/modules/scheduler/test.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/modules/scheduler/test.lua b/tests/modules/scheduler/test.lua index 36d1d97cd..364b87d2d 100644 --- a/tests/modules/scheduler/test.lua +++ b/tests/modules/scheduler/test.lua @@ -13,4 +13,18 @@ function test_runjobs(t) t:are_equal(count, 100) end +function test_sleep(t) + + --[[ + local task = function (a) + local dt = os.mclock() + scheduler.sleep(500) + dt = os.mclock() - dt + t:require(dt > 100 and dt < 1000) + end + for i = 1, 3 do + scheduler.co_start(task) + end + scheduler.runloop()]] +end |
