IStopwatchProvider.cs 910 B

12345678910111213141516171819202122232425
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. using System;
  3. namespace System.Reactive.Concurrency
  4. {
  5. /*
  6. * The ability to request a stopwatch object has been introduced in Rx v2.0 to reduce the
  7. * number of allocations made by operators that use absolute time to compute relative time
  8. * diffs, such as TimeInterval and Delay. This causes a large number of related objects to
  9. * be allocated in the BCL, e.g. System.Globalization.DaylightTime.
  10. */
  11. /// <summary>
  12. /// Provider for IStopwatch objects.
  13. /// </summary>
  14. public interface IStopwatchProvider
  15. {
  16. /// <summary>
  17. /// Starts a new stopwatch object.
  18. /// </summary>
  19. /// <returns>New stopwatch object; started at the time of the request.</returns>
  20. IStopwatch StartStopwatch();
  21. }
  22. }