1
0
mirror of synced 2026-04-05 11:08:44 +08:00

重命名 c# 为 C#

This commit is contained in:
yitter
2021-03-13 22:55:09 +08:00
committed by Gitee
parent 8b827bf8e1
commit 55e12b9bd6
15 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Yitter.IdGenerator;
namespace Yitter.OrgSystem.TestA
{
public class GenTest
{
private IIdGenerator IdGen;
private Hashtable ids = new Hashtable();
public IList<long> idList = new List<long>();
private int GenIdCount;
private int WorkerId;
public GenTest(IIdGenerator idGen, int genIdCount, int workerId)
{
GenIdCount = genIdCount;
IdGen = idGen;
WorkerId = workerId;
}
//public void GenId()
//{
// Thread t = new Thread(new ThreadStart(Gen1Start));
// t.Start();
//}
public void GenStart()
{
DateTime start = DateTime.Now;
for (int i = 0; i < GenIdCount; i++)
{
var id = IdGen.NewLong();
//ids.Add(id, i);
idList.Add(id);
}
DateTime end = DateTime.Now;
Console.WriteLine($"++++++++++++++++++++++++++++++++++++++++WorkerId: {WorkerId}, total: {(end - start).TotalSeconds} s");
Interlocked.Increment(ref Program.Count);
}
}
}