Skip to content
Snippets Groups Projects
Commit c28911dd authored by Michele Tartara's avatar Michele Tartara
Browse files

Add function for getting the timestamp in nanoseconds


The timestamp is returned as an integer number of nanoseconds since the Unix
epoch.

Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent ab98e236
No related branches found
No related tags found
No related merge requests found
......@@ -525,6 +525,16 @@ def MergeTime(timetuple):
return float(seconds) + (float(microseconds) * 0.000001)
def EpochNano():
"""Return the current timestamp expressed as number of nanoseconds since the
unix epoch
@return: nanoseconds since the Unix epoch
"""
return int(time.time() * 1000000000)
def FindMatch(data, name):
"""Tries to find an item in a dictionary matching a name.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment