File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import json
2+ import threading
23import time
34import uuid
4- from concurrent .futures import ThreadPoolExecutor , Future
5+ from concurrent .futures import Future
56from typing import Any , Callable , List , Optional
67
78import requests
@@ -119,8 +120,7 @@ def set_kernel_id():
119120 self ._sandbox .filesystem .read ("/root/.jupyter/kernel_id" , timeout = timeout ).strip ()
120121 )
121122
122- with ThreadPoolExecutor (thread_name_prefix = "e2b-get-default-kernel-id" ) as executor :
123- executor .submit (set_kernel_id )
123+ threading .Thread (target = set_kernel_id ).start ()
124124
125125 def _connect_kernel (self , kernel_id : str , timeout : Optional [float ] = TIMEOUT ):
126126 return create_connection (
Original file line number Diff line number Diff line change 2828 sandbox .close ()
2929
3030
31- print (f"Average Create Sandbox Time: { createSandboxTime / iterations } ms " )
32- print (f"Average Execute Python x = 1 Time: { exec_python_x_equals_1_time / iterations } ms " )
33- print (f"Average Execute Python x+=1; x Time: { exec_python_x_plus_equals_1_time / iterations } ms " )
31+ print (f"Average Create Sandbox Time: { createSandboxTime / iterations } s " )
32+ print (f"Average Execute Python x = 1 Time: { exec_python_x_equals_1_time / iterations } s " )
33+ print (f"Average Execute Python x+=1; x Time: { exec_python_x_plus_equals_1_time / iterations } s " )
You can’t perform that action at this time.
0 commit comments