public async Task <Dictionary <string, long> > MapElapsedTimesByNameAsync(string user) { // Whenever a stopwatch is started/restarted, a timestamp (in ticks) is stored. // We subtract stored time from current time and convert to milliseconds. return((await _repository.MapTimestampsByNameAsync(user)).ToDictionary( x => x.Key, x => (_getTimestamp() - x.Value) / TimeSpan.TicksPerMillisecond)); }