Skip to content

Commit dd657c4

Browse files
devoidcolaboratory-team
authored andcommitted
No public description
PiperOrigin-RevId: 831590223
1 parent 839cdcd commit dd657c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google/colab/_kernel.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# limitations under the License.
1414
"""Colab-specific kernel customizations."""
1515

16+
import time
17+
1618
from google.colab import _shell
1719
from google.colab import _shell_customizations
1820
from ipykernel import ipkernel
@@ -27,6 +29,7 @@ def _shell_class_default(self):
2729
return _shell.Shell
2830

2931
def do_inspect(self, code, cursor_pos, detail_level=0, *args, **kwargs):
32+
start_time = time.perf_counter_ns()
3033
name = tokenutil.token_at_cursor(code, cursor_pos)
3134
info = self.shell.object_inspect(name)
3235

@@ -50,6 +53,7 @@ def do_inspect(self, code, cursor_pos, detail_level=0, *args, **kwargs):
5053
'data': data,
5154
'metadata': {},
5255
'found': info['found'],
56+
'elapsed_ms': (time.perf_counter_ns() - start_time) / 1000000,
5357
}
5458

5559
return reply_content

0 commit comments

Comments
 (0)