我正在研究一个项目,我有一个写文本较慢的函数:
public static void Slow_Writing(string text)
{
char ch;
for (int i = 0; i < text.Length; i++)
{
ch = text[i];
Thread.Sleep(40);
Console.Write(ch);
}
}
当有人在写入时点击鼠标时,它会停止。我怎样才能防止它停止运转?