MCPcopy Create free account
hub / github.com/alibaba/GraphScope / get_timestamp

Function get_timestamp

python/graphscope/framework/utils.py:257–273  ·  view source on GitHub ↗

Get current timestamp. Returns: Str of current time in seconds since the Epoch. Examples: >>> get_timestamp() '1639108065.941239' >>> get_timestamp(with_milliseconds=False) '1639108065'

(with_milliseconds=True)

Source from the content-addressed store, hash-verified

255
256
257def get_timestamp(with_milliseconds=True):
258 """Get current timestamp.
259
260 Returns:
261 Str of current time in seconds since the Epoch.
262
263 Examples:
264 >>> get_timestamp()
265 '1639108065.941239'
266
267 >>> get_timestamp(with_milliseconds=False)
268 '1639108065'
269 """
270 t = str(time.time())
271 if not with_milliseconds:
272 t = t.split(".")[0]
273 return t
274
275
276def read_file_to_bytes(file_path):

Callers 1

wrap_initFunction · 0.90

Calls 2

timeMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected