Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
actions and tasks
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks;//required for tasks / concurrent programming namespace Rextester { public class Program { public static void Main(string[] args) { string str; Action a; Task t; a = () => Console.WriteLine("Test"); a += delegate { Console.WriteLine("Test2"); }; str = "testingasync"; t = RunAsync(str); t = Task.Factory.StartNew(()=>ShowThreadInfo("abc")); a(); } static void ShowThreadInfo(String s) { Console.WriteLine("{0} Thread ID: {1}", s, Thread.CurrentThread.ManagedThreadId); } private static async Task RunAsync(String s) { await Task.Run(()=>{Console.WriteLine(s);}); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
code1
Date Comparison
compiled prog
Beadando Simon Szabolcs
Serialization
c# string abbreviation
Program
How to count the occurrence of each character in a string?
List, Object, Classes, Function
Number of Digits in a Number
stackse - search stackoverflow differently
Please log in to post a comment.