DictTest
This commit is contained in:
24
TestProgram/DtsodC/DictTest.cs
Normal file
24
TestProgram/DtsodC/DictTest.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using static DTLib.Experimental.Tester;
|
||||
|
||||
namespace TestProgram;
|
||||
|
||||
static class DictTest
|
||||
{
|
||||
static void Fill(Dictionary<string,long> dict){
|
||||
for(long i=0;i<100000;i++)
|
||||
dict.Add($"key__{i}",i);
|
||||
}
|
||||
static long Gett(Dictionary<string,long> dict){
|
||||
long r=0;
|
||||
for(long i=0;i<100000;i++)
|
||||
r=dict[$"key__{i}"];
|
||||
return r;
|
||||
}
|
||||
|
||||
static public void Test(){
|
||||
Console.WriteLine("----------------[dict.cs]----------------");
|
||||
Dictionary<string,long> dict=new();
|
||||
LogOperationTime("fill",1,()=>Fill(dict));
|
||||
LogOperationTime("gett",1,()=>Gett(dict));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,4 @@
|
||||
using System.Threading;
|
||||
using DTLib.Dtsod;
|
||||
using DTLib.Experimental;
|
||||
using static TestProgram.Program;
|
||||
using static TestProgram.Program;
|
||||
|
||||
namespace TestProgram.DtsodV2X;
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@ global using System.Collections;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Text;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
global using DTLib;
|
||||
global using DTLib.Extensions;
|
||||
global using DTLib.Experimental;
|
||||
global using DTLib.Filesystem;
|
||||
using DTLib.Dtsod;
|
||||
global using DTLib.Dtsod;
|
||||
using DTLib.Loggers;
|
||||
using TestProgram.DtsodV2X;
|
||||
|
||||
@@ -28,7 +30,8 @@ static class Program
|
||||
try
|
||||
{
|
||||
Info.Log("g","-------[DTLib tester]-------");
|
||||
TestDtsodV23.TestAll();
|
||||
//TestDtsodV23.TestAll();
|
||||
DictTest.Test();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{ Info.Log("r", ex.ToString()); }
|
||||
|
||||
Reference in New Issue
Block a user