MCPcopy Create free account
hub / github.com/apache/fory / format_time

Function format_time

benchmarks/python/fory_benchmark.py:505–514  ·  view source on GitHub ↗

Format time in human-readable units

(seconds)

Source from the content-addressed store, hash-verified

503
504
505def format_time(seconds):
506 """Format time in human-readable units"""
507 if seconds < 1e-6:
508 return f"{seconds * 1e9:.2f} ns"
509 elif seconds < 1e-3:
510 return f"{seconds * 1e6:.2f} us"
511 elif seconds < 1:
512 return f"{seconds * 1e3:.2f} ms"
513 else:
514 return f"{seconds:.2f} s"
515
516
517def micro_benchmark():

Callers 1

micro_benchmarkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected