# Sample: writing your own awaitable

`await` is a compiler pattern, not an interface. Anything with a GetAwaiter method whose return type has
IsCompleted, GetResult and OnCompleted can be awaited.

- TimeSpanAwaitableExtensions makes `await TimeSpan.FromSeconds(1)` compile, using an extension method.
- ThreadPoolAwaitable moves the rest of the method to the thread pool, whatever the current context says.

    cd CustomAwaitable
    dotnet run -c Release

    cd CustomAwaitable.Tests
    dotnet run -c Release
