File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,6 +338,8 @@ def _run(self):
338338 self ._cleanup ()
339339
340340 def elapsed_time (self ):
341+ """Return the total time elapsed since the runner
342+ was started."""
341343 if self .end_time is None :
342344 # This shouldn't happen if the BlockingRunner
343345 # correctly finished.
@@ -532,6 +534,8 @@ async def _run(self):
532534 self ._cleanup ()
533535
534536 def elapsed_time (self ):
537+ """Return the total time elapsed since the runner
538+ was started."""
535539 if self .task .done ():
536540 end_time = self .end_time
537541 if end_time is None :
Original file line number Diff line number Diff line change @@ -298,6 +298,15 @@ raise the exception with the stack trace:
298298
299299 runner.task.result()
300300
301+
302+ You can also check ``runner.tracebacks `` which is a mapping from
303+ point → traceback.
304+
305+ .. jupyter-execute ::
306+
307+ for point, tb in runner.tracebacks.items():
308+ print(f'point: {point}:\n {tb}')
309+
301310Logging runners
302311~~~~~~~~~~~~~~~
303312
@@ -337,10 +346,16 @@ set of operations on another runner:
337346
338347 learner.plot().Scatter.I.opts(style=dict(size=6)) * reconstructed_learner.plot()
339348
340- Timing functions
341- ~~~~~~~~~~~~~~~~
349+ Adding coroutines
350+ -----------------
351+
352+ In the following example we'll add a `~asyncio.Task ` that times the runner.
353+ This is *only * for demonstration purposes because one can simply
354+ check ``runner.elapsed_time() `` or use the ``runner.live_info() ``
355+ widget to see the time since the runner has started.
342356
343- To time the runner you **cannot ** simply use
357+ So let's get on with the example. To time the runner
358+ you **cannot ** simply use
344359
345360.. code :: python
346361
You can’t perform that action at this time.
0 commit comments