I've noticed I can use %time from the terminal/sage CLI inline with a statement; but I get a syntax error in the notebook. Is there a way I can put %time inline inside a notebook cell?
"%time; statement" or "%time statement" doesn't work (in the notebook).
Aside: It would be nice if I could get the starting time (of evaluation) as a side-effect too, not just the CPU and Wall Time.
You can't put
If you really need to do some timing in the middle of the cell, there is the
If you want to get the starting time of evaluation, you can put this near the beginning of the cell
and it should give you some output like
See the Python documentation for the time module for more information about this.
posted Aug 23 '10Mike Hansen
3840 ● 21 ● 46 ● 84
As far as I know,
works for timing the execution of the whole cell. Meanwhile, there is an inline
statement, which one may put at the beginning of the line like this:
To compare how these two tools work, you may try executing the following cell:
The output should look like this:
Hope that helps. :)
Asked: Aug 23 '10
Seen: 292 times
Last updated: Dec 08 '10
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.