mirror of
https://github.com/nmap/nmap.git
synced 2025-12-27 09:59:04 +00:00
Add nmap.clock() for providing scripts with the current time in floating
point seconds since the epoch, and add clock_ms() and clock_us() to stdnse for convenience (millisecond and microsecond). qscan.nse now provides microsecond resolution.
This commit is contained in:
@@ -389,6 +389,18 @@ function format_difftime(t2, t1)
|
||||
return sign .. s
|
||||
end
|
||||
|
||||
--- Returns the current time in milliseconds since the epoch
|
||||
-- @return The current time in milliseconds since the epoch
|
||||
function clock_ms()
|
||||
return nmap.clock() * 1000
|
||||
end
|
||||
|
||||
--- Returns the current time in microseconds since the epoch
|
||||
-- @return The current time in microseconds since the epoch
|
||||
function clock_us()
|
||||
return nmap.clock() * 1000000
|
||||
end
|
||||
|
||||
---Get the indentation symbols at a given level.
|
||||
local function format_get_indent(indent, at_end)
|
||||
local str = ""
|
||||
|
||||
Reference in New Issue
Block a user