private TimeSpan GetTimeElapsed(Stopwatch watch) { if (watch.IsRunning) { return watch.Elapsed; } return _keepAliveInterval; } }