dotnet / dotnet/dotnet-api-docs

Consider mentioning the difference between: `Thread.Sleep()` & `Task.Delay()`

Open
#1,660 0 comments 0 reactions 0 assignees View on GitHub
area-System.Threading.Tasks dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Assume for a moment that the developer has a reasonable argument for calling Sleep\Delay.

I think it would be helpful for programmers to understand the difference between calling `Thread.Sleep()` or `Task.Delay()` from within a task.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 6ec08720-a8de-c325-20d4-7735044afa5a
* Version Independent ID: e3828f5f-0390-8640-3e1d-518b1f08145a
* Content: [Task.Delay Method (System.Threading.Tasks)](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.delay?view=netframework-4.7#System_Threading_Tasks_Task_Delay_System_Int32_)
* Content Source: [xml/System.Threading.Tasks/Task.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Threading.Tasks/Task.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.