I dug around a bit and did not find a simple and clear implementation of countdown stopwatch in Mathematica. I am looking for a function that takes as an input a certain integer and then counts down by 1 every second till 0 is reached. I think it could be an important part for some examples. Kernel or Front End implementations are both acceptable. Here is my take on it:
timer[s_] := Module[{x = AbsoluteTime[], y = AbsoluteTime[]},
RunScheduledTask[y = AbsoluteTime[], {1, s}];
Dynamic[s - Floor[y - x]]]
It's a bit hacky but works ;-) I have seen the following questions already:
but I do not think they do what I was looking for. They either run time forward, are too complex, or something else. Did I miss anything? Does anyone have better ideas?