x
using System; using System.Threading; public static class Program{
public static void Main(){
Timer t = new Timer(TimerCallback,null,0,2000); Console.ReadLine(); } private static void TimerCallback(Object obj){ Console.WriteLine("In TimerClallback : " DateTime.Now); //假装此时执行了GC //出于演示目的,强制执行一次辣鸡回收 GC.Collect(); }
运行可执行文件,TimerCallback方法江北调用几次?
Why?
[0]Jeffrey Richter. CLR via C#[M]. 第4版. 清华大学出版社.
x
原文:https://www.cnblogs.com/love-zf/p/10182410.html