Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             MethodAsync();
  14.             for(int i = 100; i < 200; i++)
  15.             {
  16.                 Console.WriteLine(i);
  17.             }
  18.  
  19.             Console.ReadLine();
  20.         }
  21.  
  22.         static async void MethodAsync()
  23.         {
  24.             await Task.Run(() => Method());
  25.         }
  26.  
  27.         static void Method()
  28.         {
  29.             for(int i = 0; i < 100; i++)
  30.             {
  31.                 Console.WriteLine(i + "\n");
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement