using MySql.Data.MySqlClient;
using System;
using System.Diagnostics;
using System.Threading;
namespace 数据库悲观锁
{
class Program
{
static void Main(string[] args)
{
Stopwatch stopwatch = Stopwatch.StartNew();
for (int x = 0, y = 100; x < y; x++)
{
int z = 0;
Thread s = new Thread(MySqlHelper.UpdataToMySql);
s.Start();
z++;
}
//MySqlHelper.UpdataToMySql();
Console.WriteLine("结束");
Console.WriteLine("DateTime总共花费{0}ms.", stopwatch.ElapsedMilliseconds);
Console.ReadKey();
}
}
class MySqlHelper
{
public static void UpdataToMySql()