IStopwatchProvider.cs 988 B

123456789101112131415161718192021222324252627
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 License.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. namespace System.Reactive.Concurrency
  6. {
  7. /*
  8. * The ability to request a stopwatch object has been introduced in Rx v2.0 to reduce the
  9. * number of allocations made by operators that use absolute time to compute relative time
  10. * diffs, such as TimeInterval and Delay. This causes a large number of related objects to
  11. * be allocated in the BCL, e.g. System.Globalization.DaylightTime.
  12. */
  13. /// <summary>
  14. /// Provider for IStopwatch objects.
  15. /// </summary>
  16. public interface IStopwatchProvider
  17. {
  18. /// <summary>
  19. /// Starts a new stopwatch object.
  20. /// </summary>
  21. /// <returns>New stopwatch object; started at the time of the request.</returns>
  22. IStopwatch StartStopwatch();
  23. }
  24. }