Skip to content

Class for logging excessive blocking on the main thread

Notifications You must be signed in to change notification settings

AlfredTheBest/Watchdog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Watchdog

Class for logging excessive blocking on the main thread


Class for logging excessive blocking on the main thread. It watches the main thread and checks if it doesn’t get blocked for more than defined threshold. You can also inspect which part of your code is blocking the main thread.

##Usage

When the app initialize , add a watch dog and actively monitoring the main thread.

Watchdog *dog = [[Watchdog alloc] initWithThreshold:4.0 andStrictMode:YES];

Also you can call the function below to customizea watch dog which can use your design reaction.

/**
 Initializes an instance of a watch dog to keep monitoring main thread.
 
 @param threshold the time interval for watching.
 
 @param strict customize reaction.
 
 @return An initialized watch dog, actively monitoring the main thread.
 */
- (instancetype)initWithThreshold:(double)threshold
                 andFiredCallback:(block)handler;

About

Class for logging excessive blocking on the main thread

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published