StopwatchImpl.cs 868 B

12345678910111213141516171819202122232425262728
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. #if !NO_STOPWATCH
  3. using System.Diagnostics;
  4. namespace System.Reactive.Concurrency
  5. {
  6. //
  7. // WARNING: This code is kept *identically* in two places. One copy is kept in System.Reactive.Core for non-PLIB platforms.
  8. // Another copy is kept in System.Reactive.PlatformServices to enlighten the default lowest common denominator
  9. // behavior of Rx for PLIB when used on a more capable platform.
  10. //
  11. internal class /*Default*/StopwatchImpl : IStopwatch
  12. {
  13. private readonly Stopwatch _sw;
  14. public StopwatchImpl()
  15. {
  16. _sw = Stopwatch.StartNew();
  17. }
  18. public TimeSpan Elapsed
  19. {
  20. get { return _sw.Elapsed; }
  21. }
  22. }
  23. }
  24. #endif