@@ -18,7 +18,7 @@ def timed_run(sandbox, code, label="run"):
1818 start = time .perf_counter ()
1919 result = sandbox .run (code )
2020 elapsed_ms = (time .perf_counter () - start ) * 1000
21- print (f"⏱️ { label } : { elapsed_ms :.1f} ms" )
21+ print (f"[timer] { label } : { elapsed_ms :.1f} ms" )
2222 return result
2323
2424
@@ -31,7 +31,7 @@ def timed_run(sandbox, code, label="run"):
3131 "This example requires the Wasm backend and packaged Python guest package. "
3232 "Install hyperlight-sandbox[wasm,python_guest] or run `just python-build`."
3333 ) from exc
34- print (f"⏱️ Sandbox created (lazy): { (time .perf_counter () - t0 ) * 1000 :.1f} ms" )
34+ print (f"[timer] Sandbox created (lazy): { (time .perf_counter () - t0 ) * 1000 :.1f} ms" )
3535
3636# Register host tools before first run()
3737sandbox .register_tool ("add" , lambda a = 0 , b = 0 : a + b )
@@ -89,14 +89,14 @@ async def async_multiply(a: float, b: float):
8989print ("\n --- Test 4: Snapshot/restore ---" )
9090t0 = time .perf_counter ()
9191snap = sandbox .snapshot ()
92- print (f"⏱️ snapshot: { (time .perf_counter () - t0 ) * 1000 :.1f} ms" )
92+ print (f"[timer] snapshot: { (time .perf_counter () - t0 ) * 1000 :.1f} ms" )
9393
9494result1 = timed_run (sandbox , 'x = 42; print(f"x = {x}")' , "pre-restore run" )
9595print (f"Before restore: { result1 .stdout !r} " )
9696
9797t0 = time .perf_counter ()
9898sandbox .restore (snap )
99- print (f"⏱️ restore: { (time .perf_counter () - t0 ) * 1000 :.1f} ms" )
99+ print (f"[timer] restore: { (time .perf_counter () - t0 ) * 1000 :.1f} ms" )
100100
101101result2 = timed_run (
102102 sandbox ,
@@ -156,4 +156,4 @@ async def async_multiply(a: float, b: float):
156156assert "26" in lines [1 ], f"Expected 26, got: { lines [1 ]} "
157157assert "gpt-4" in lines [2 ], f"Expected gpt-4 in greeting, got: { lines [2 ]} "
158158
159- print ("\n ✅ All tests passed!" )
159+ print ("\n [ok] All tests passed!" )
0 commit comments