Re: How do I get Timing results in Out[]//<Message>?
- To: mathgroup at smc.vnet.net
- Subject: [mg43919] Re: [mg43917] How do I get Timing results in Out[]//<Message>?
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sun, 12 Oct 2003 04:03:40 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Saturday, October 11, 2003, at 02:33 PM, Scott Centoni wrote:
> I remember reading a very neat tip on how to get Timing[] wrapped
> around
> every evaluation by default, and the results printed out in the blue
> Out[123]= line for each output cell in the notebook so that it doesn't
> clutter up your output. I think I remember reading this tip in The
> Mathematica Journal, but I can't find it. Do any of you know what I'm
> referring to?
>
> Note that this is rather like
>
> In[54]:=
> IdentityMatrix[4]//TableForm
>
> Out[54]//TableForm=
> {{1, 0, 0, 0},
> {0, 1, 0, 0},
> {0, 0, 1, 0},
> {0, 0, 0, 1}
> }
>
> and completely different from the following trick at the support web
> site to put the timing in the status line, the lower left corner of the
> window:
>
>> How do I get Mathematica to display the timing of an evaluation in
>> lower-left corner of my notebook?
>>
>> You can have the timing of each evaluation displayed in the
>> lower-left corner of a notebook by going to the Option Inspector and
>> adding the value "ShowTiming" to the option
>>
>> Notebook Options|Evaluation Options|EvaluationCompletionAction
>
> (http://support.wolfram.com/mathematica/interface/customize/
> displaytiming.html)
>
> which I find almost useless because as soon as your 5-minute evaluation
> finishes, it's timing is overwritten by the one after it, which only
> takes 0.04 seconds.
>
> Thanks,
> Scott
>
>
>
I am not sure this is the same method as the one you are referring to,
but setting:
$Pre = Function[{x}, Timing[x], HoldAll];
should do what you want. eg:
In[2]:=
Map[PrimeQ,Range[10^3]];
Out[2]=
{0.06 Second,Null}
Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/