mirror of
https://github.com/andreinechaev/nvcc4jupyter.git
synced 2026-06-13 18:50:47 +05:30
Convert TimeitResult object to human readable string in v1.py
This commit is contained in:
committed by
Andrei Nechaev
parent
0a71d56e5d
commit
6f2cc6f13c
@@ -28,6 +28,7 @@ class NVCCPlugin(Magics):
|
|||||||
stmt = f"subprocess.check_output(['{file_path}.out'], stderr=subprocess.STDOUT)"
|
stmt = f"subprocess.check_output(['{file_path}.out'], stderr=subprocess.STDOUT)"
|
||||||
output = self.shell.run_cell_magic(
|
output = self.shell.run_cell_magic(
|
||||||
magic_name="timeit", line="-q -o import subprocess", cell=stmt)
|
magic_name="timeit", line="-q -o import subprocess", cell=stmt)
|
||||||
|
output = str(output) # convert TimeitResult object to human readable string
|
||||||
else:
|
else:
|
||||||
output = subprocess.check_output(
|
output = subprocess.check_output(
|
||||||
[file_path + ".out"], stderr=subprocess.STDOUT)
|
[file_path + ".out"], stderr=subprocess.STDOUT)
|
||||||
|
|||||||
Reference in New Issue
Block a user