提交 8d739f1a 编写于 作者: Y yixiangboy

卡顿阈值<1秒钟的话,会导致卡顿拦截堆栈不准确的问题修复。

上级 e8f1f934
...@@ -18,7 +18,7 @@ typedef void (^DoraemonANRManagerBlock)(NSDictionary *anrInfo); ...@@ -18,7 +18,7 @@ typedef void (^DoraemonANRManagerBlock)(NSDictionary *anrInfo);
/* /*
卡顿时长阈值,单位为秒, 卡顿时长阈值,单位为秒,
*/ */
@property (nonatomic, assign) int64_t timeOut; @property (nonatomic, assign) CGFloat timeOut;
- (void)addANRBlock:(DoraemonANRManagerBlock)block; - (void)addANRBlock:(DoraemonANRManagerBlock)block;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#import "DoraemonHealthManager.h" #import "DoraemonHealthManager.h"
//默认超时间隔 //默认超时间隔
static int64_t const kDoraemonBlockMonitorTimeInterval = 1.; static CGFloat const kDoraemonBlockMonitorTimeInterval = 0.5f;
@interface DoraemonANRManager() @interface DoraemonANRManager()
......
...@@ -189,8 +189,8 @@ ...@@ -189,8 +189,8 @@
} }
- (void)anrClick{ - (void)anrClick{
NSLog(@"5秒钟的卡顿"); NSLog(@"1秒钟的卡顿");
[NSThread sleepForTimeInterval:5.0]; [NSThread sleepForTimeInterval:1.0];
// for(int i=0 ; i< 50000; i++){ // for(int i=0 ; i< 50000; i++){
// UIView *v = [[UIView alloc] init]; // UIView *v = [[UIView alloc] init];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册