C# 常用方法收集


C# 获取某个操作的内存消耗:

long start = GC.GetTotalMemory(true); // ......某个操作...... GC.Collect();
    GC.WaitForFullGCComplete();

    long end = GC.GetTotalMemory(true);
    long useMemory = end - start;

C# 获取某个操作的时间消耗:

    System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
    watch.Start();
    //.......某个操作.......
    watch.Stop();
    var useTimes = (double)watch.ElapsedMilliseconds / 1000; 


sql

where patindex('%[吖-座]%',[U_Name]) > 0

你可能感兴趣的:(.net,C#)