开发者

check first with timestamp?

开发者 https://www.devze.com 2023-01-02 01:08 出处:网络
do i save some time when having a timestamp and o开发者_JS百科nly ask the operation isCancelled every 50 msec?isCancelled is a pretty simple BOOL flag, so checking it on each iteration of even a very

do i save some time when having a timestamp and o开发者_JS百科nly ask the operation isCancelled every 50 msec?


isCancelled is a pretty simple BOOL flag, so checking it on each iteration of even a very tight loop doesn't incur a real performance penalty. I think you'll find the overhead of setting up a mechanism to check isCancelled periodically will actually perform worse.

0

精彩评论

暂无评论...
验证码 换一张
取 消