Skip to content

Commit 2cb875f

Browse files
committed
Add timing info for _scrollViewDidChangeBounds:
1 parent 602c224 commit 2cb875f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Source/SPObjectAdditions.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ - (void)_scrollViewDidChangeBounds:(id)obj
5050
{
5151
NSMutableString *msg = [NSMutableString string];
5252

53-
[msg appendFormat:@"%s tripped!\n\n",__PRETTY_FUNCTION__];
53+
[msg appendFormat:@"%s tripped!\n",__PRETTY_FUNCTION__];
54+
55+
[msg appendFormat:@" at %@ (mach time: %lf)\n\n",[NSDate date],[NSDate monotonicTimeInterval]];
5456

5557
retryDescribe:
5658
[msg appendFormat:@"passed object (class <%@>): %@\n\n",[obj className],obj];
@@ -136,6 +138,7 @@ - (void)sp_addObserver:(id)notificationObserver selector:(SEL)notificationSelect
136138
if(notificationSelector == @selector(_scrollViewDidChangeBounds:) && [notificationName isEqualToString:NSViewBoundsDidChangeNotification]) {
137139
NSString *key = [NSString stringWithFormat:@"snd=%p,obs=%p",notificationSender,notificationObserver];
138140
NSMutableString *val = [NSMutableString string];
141+
[val appendFormat:@"at %@ (mach time: %lf)\n",[NSDate date],[NSDate monotonicTimeInterval]];
139142
[val appendFormat:@"observer: %1$p (class %2$@) description: %1$@\n",notificationObserver,[notificationObserver className]];
140143
if([notificationObserver isKindOfClass:[NSView class]]) {
141144
[val appendFormat:@" view info: id=%@, tag=%ld\n",[(NSView *)notificationObserver identifier], [(NSView *)notificationObserver tag]];
@@ -176,7 +179,7 @@ + (void)load
176179
- (void)sp_dealloc
177180
{
178181
NSString *key = [NSString stringWithFormat:@"=%p",self];
179-
NSString *val = [NSString stringWithFormat:@"\ndealloc backtrace:\n%@\n\n",[NSThread callStackSymbols]];
182+
NSString *val = [NSString stringWithFormat:@"\n%p dealloc\n at %@ (mach time: %lf)\n backtrace:\n%@\n\n",self,[NSDate date],[NSDate monotonicTimeInterval],[NSThread callStackSymbols]];
180183

181184
[gScrollViewDealloc setObject:val forKey:key];
182185

0 commit comments

Comments
 (0)