diff options
| author | ruki <[email protected]> | 2020-02-05 00:57:48 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-02-07 22:45:56 +0800 |
| commit | f48d5e6837c0039651385f409c8f3fc8188e086b (patch) | |
| tree | 461baae6a5785197c1b3faf937986ef9ea9af6b0 /tests | |
| parent | 71e29f82a04a6a799997eda741c318969c57354b (diff) | |
improve runjobs to support timer
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modules/scheduler/runjobs.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/modules/scheduler/runjobs.lua b/tests/modules/scheduler/runjobs.lua index 36f72b47f..73398d179 100644 --- a/tests/modules/scheduler/runjobs.lua +++ b/tests/modules/scheduler/runjobs.lua @@ -10,6 +10,9 @@ function _jobfunc(index) end function main() - runjobs("test", _jobfunc, 100, 6) + local t = os.mclock() + runjobs("test", _jobfunc, 100, 6, 1000, function (running_jobs_indices) + print("%s: timeout (%d ms), running: %s", scheduler.co_running(), os.mclock() - t, table.concat(running_jobs_indices, ",")) + end) end |
