# Use EvaluationCompletionAction to notify me only after long evaluation

Is it possible to use the option EvaluationCompletionAction to notify me (e.g. with a Beep[]) when an evaluation that took longer than, for example, 30s is finished?

One of the default settings for EvaluationCompletionAction is "ShowTiming" which indicates that the FrontEnd is in some way aware of the duration of evaluations.

Ideally, I would want something like this:

SetOptions[
$FrontEnd, EvaluationCompletionAction -> Which[duration > 30, Beep[]] ]  Is it possible to do this? And could anyone point me in a direction how to accomplish this? ## 1 Answer It doesn't seem to be possible with EvaluationCompletionAction but you can wrap input with custom function using $PreRead and friends:

$Pre = Function[expr, Module[{start, result}, start = AbsoluteTime[]; result = expr; If[AbsoluteTime[] - start > 2, Speak @ "wow, it took at least 2 seconds"]; result ], HoldAll ]  I'm using Speak instead of Beep because I can't make the latter work on my machine :P So now, evaluating Pause[3]  should Print a message. • Different approach but it works. Haven't met the $PreRead family before... – Aart Goossens Nov 26 '15 at 9:25
• @AartGoossens yep, they are quite useful sometimes, you can search around for related answers. I'm glad it helps, good luck. :) – Kuba Nov 26 '15 at 9:27
• @AartGoossens Make it Speak[ ] something... it is much funnier! You can even randomly choose from a list of jokes... – P. Fonseca Nov 26 '15 at 16:45
• @P.Fonseca :-)) Best idea ever, done :) – Kuba Nov 26 '15 at 16:48