1 ---------------------------------
5 ---------------------------------
9 local dpdk = require
"dpdk"
14 function mod:
new(time)
17 stop = dpdk.getTime() + (time or 0)
22 return self.stop > dpdk.
getTime()
25 function timer:expired()
26 return self.stop <= dpdk.
getTime()
29 function timer:timeLeft()
30 return self.stop - dpdk.
getTime()
33 function timer:reset(time)
34 self.stop = dpdk.
getTime() + (time or self.time)
37 --- Perform a busy
wait on the timer.
38 -- Returns early if MoonGen is stopped (mg.
running() == false).
40 while not self:expired() and dpdk.
running() do
45 --- Perform a non-busy
wait on the timer.
46 --- Might be less accurate than
busyWait()
function timer busyWait()
Perform a busy wait on the timer.
local mod
high-level dpdk wrapper
function mod stop()
request all tasks to exit
function timer wait()
Perform a non-busy wait on the timer.
function mod getTime()
gets the time in seconds
function mod running(extraTime)
Returns false once the app receives SIGTERM or SIGINT, the time set via setRuntime expires...