Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jpalcala committed Feb 16, 2018
1 parent f32d792 commit 125095b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Repeating code and reinventing the wheel is generally considered bad practice. A
* [The SettingsProvider abstraction](#the-settingsprovider-abstraction)
* [The Connection class](#the-connection-class)
* [The Benchmark component](#the-benchmark-component)
* [The DelayProvider component](#the-delayprovider-component)

## Libraries
We offer the Swan library in two flavors since version 0.24. Swan Lite provides basic classes and extension methods and Swan Standard (we call it Fat Swan) provides everything in Swan Lite plus Network, WinServices, DI and more. See the following table to understand the components available to these flavors of Swan.
Expand Down Expand Up @@ -986,3 +987,29 @@ using (Benchmark.Start("Test"))
// dump results into a string
var results = Benchmark.Dump();
```
### The `DelayProvider` component
A useful component that implements several delay mechanisms.

#### Example 1: Creating a delay
```csharp
// by default DelayProvider uses the TaskDelay strategy
var delay = new DelayProvider();

//wait
delay.WaitOne();

//dispose
delay.Dispose();
```

or with the `using` statement

```csharp
// this time use the ThreadSleep strategy
using (var delay = new DelayProvider(DelayProvider.DelayStrategy.ThreadSleep))
{
// retrieve how much time we delayed
var time = delay.WaitOne();
}
```

0 comments on commit 125095b

Please sign in to comment.