/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/DateTime/Overview/csharp/Resolution.cs
34 строки
894 B
Genevieve Warren
Add remarks for core types (#38970)
05 янв 2024, 22:14
Не верифицирован
05 янв 2024, 22:14
71d1377
Код
Авторство
О чём код?
using System; namespace SystemDateTimeReference { public static class Resolution { public static void Snippets() { DemonstrateResolution(); } private static void DemonstrateResolution() { // <Snippet1> string output = ""; for (int ctr = 0; ctr <= 20; ctr++) { output += String.Format($"{DateTime.Now.Millisecond}\n"); // Introduce a delay loop. for (int delay = 0; delay <= 1000; delay++) { } if (ctr == 10) { output += "Thread.Sleep called...\n"; System.Threading.Thread.Sleep(5); } } Console.WriteLine(output); // Press "Run" to see the output. // </Snippet1> } } }