I need a slow C# function

前端 未结 6 2056
耶瑟儿~
耶瑟儿~ 2020-12-05 09:47

For some testing I\'m doing I need a C# function that takes around 10 seconds to execute. It will be called from an ASPX page, but I need the function to eat up CPU time on

6条回答
  •  忘掉有多难
    2020-12-05 10:27

    Just use
    Thread.Sleep(number of milliseconds here);
    You will have to add using System.Threading;

提交回复
热议问题