더북(TheBook)
import timeit

def run_test():
    chunk = video_data[byte_offset:byte_offset + size]
    # socket.send(chunk)를 호출해야 하지만 벤치마크를 위해 무시한다
    
result = timeit.timeit(
    stmt="run_test()",
    globals=globals(),
    number=100,
) 
/ 100
    
print(f"{result:0.9f} 초")

 

>>>
0.004925669 초