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)
| 255 | |
| 256 | |
| 257 | def 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 | |
| 276 | def read_file_to_bytes(file_path): |