|
@@ -1,5 +1,7 @@
|
|
|
using System;
|
|
|
-using Masuit.Tools.Core.NoSQL;
|
|
|
+using System.Diagnostics;
|
|
|
+using System.Threading;
|
|
|
+using System.Threading.Tasks;
|
|
|
|
|
|
namespace NetCoreTest
|
|
|
{
|
|
@@ -7,8 +9,20 @@ namespace NetCoreTest
|
|
|
{
|
|
|
static void Main(string[] args)
|
|
|
{
|
|
|
- RedisHelper helper = new RedisHelper();
|
|
|
- Console.WriteLine("Hello World!");
|
|
|
+ var sw = new Stopwatch();
|
|
|
+ sw.Start();
|
|
|
+ var t = SayHello();
|
|
|
+ Thread.Sleep(4000);
|
|
|
+ Console.WriteLine(t.Result);
|
|
|
+ Console.WriteLine(sw.ElapsedMilliseconds);
|
|
|
+ Console.ReadKey();
|
|
|
}
|
|
|
+ public static async Task<string> SayHello()
|
|
|
+ {
|
|
|
+ Thread.Sleep(5000);
|
|
|
+ await Task.Delay(5000);
|
|
|
+ return "hello world";
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|