1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-06 14:39:03 +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:
kris
2010-07-23 19:49:42 +00:00
parent 33845f104c
commit cc33a59ca4
6 changed files with 53 additions and 16 deletions

View File

@@ -146,6 +146,12 @@ function set_port_state(host, port, state)
-- <code>"tcpwrapped"</code>, or <code>"incomplete"</code>.
function set_port_version(host, port, probestate)
--- Returns the current date and time in seconds.
-- @return The number of seconds since the epoch (on most systems this is
-- 01/01/1970) as a floating point value.
-- @usage local now = nmap.clock()
function clock()
--- Returns the current date and time in milliseconds.
-- @return The number of milliseconds since the epoch (on most systems this is
-- 01/01/1970).