Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- using System.Threading.Tasks;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- wyswietlCzas();
- Console.ReadLine();
- }
- static async void wyswietlCzas() //pobranie w osobnym wątku co 5 sek.
- {
- while (true)
- {
- await Task.Factory.StartNew(() =>
- {
- Thread.Sleep(5000);
- Console.WriteLine(DateTime.Now);
- });
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement