Some variables have to be added to the method of the linked question to keep track of whether the stop watch is paused and the delay accumulated by the pauses.
Here's one way to adapt the method of the linked question. It still needs RunScheduledTask[time = timer["now"], 2] to be executed.
DynamicModule[{start = AbsoluteTime[], paused = 0},
makeTimer[] :=
(start = AbsoluteTime[]; paused = 0;
Switch[#,
"now", If[paused > 0, paused - start, AbsoluteTime[] - start],
"lap", If[paused > 0, paused - start, AbsoluteTime[] - start],
"reset", start = AbsoluteTime[]; If[paused > 0, paused = start]; 0.,
"pause", (paused = AbsoluteTime[]) - start,
"restart",
If[paused > 0, start += AbsoluteTime[] - paused; paused = 0];
AbsoluteTime[] - start
] &)
];
To add a pause button, a variable has to be added to keep track of the state of the timer.
DynamicModule[{state = "Pause"},
Grid[{
{Button["Start", timer = makeTimer[]; time = 0.;
state = "Pause"]}, {Button["Lap", time = timer["lap"]]},
{Button["Reset", time = timer["reset"]]},
{Button[Dynamic@state,
If[state == "Pause",
time = timer["pause"]; state = "Restart",
time = timer["restart"]; state = "Pause"]]},
{Button[Dynamic[ClockGauge@time]]}}]
]
Adding the UpdateInterval option to Refresh can control how often the stopwatch is updated.
Here's a simpler way to make a stopwatch. Clicking on it toggles the run/pause modes. Other commands may be added to the action of the Button.
DynamicModule[{time, offset = 0, stop, update = True},
Button[Dynamic@Refresh[
ClockGauge[If[update, time = Clock[Infinity], time] - offset]],
If[update,
stop = time; update = False,
offset += Clock[Infinity] - stop; update = True]]]
