How to limit the execution time of a function in c sharp?

后端 未结 8 807
太阳男子
太阳男子 2020-12-30 03:13

I\'ve got a problem. I\'m writing a benchmark and I have a function than is either done in 2 seconds or after ~5 minutes(depending on the input data). And I would like to st

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 04:07

    Use an OS callbacks with a hi performance counter, then kill your thread, if exists

提交回复
热议问题