Skip to content

Commit

Permalink
feat: ios old arch file write logic added
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamguptadream11 committed Dec 7, 2024
1 parent 00bd2e9 commit 9903c44
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ios/PerformanceTrackerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#import "PerformanceTrackerView.h"
#import "PerformanceTrackerStore.h"
#import "PerformanceTrackerWriter.h"

@implementation PerformanceTrackerView {
UIView * _view;
Expand All @@ -10,9 +11,6 @@ @implementation PerformanceTrackerView {

- (instancetype)init {
self = [super init];
if (self) {
// _storage = [[PerformanceTrackerView alloc] init];
}
return self;
}

Expand Down Expand Up @@ -45,10 +43,6 @@ - (void)didMoveToWindow {

_alreadyLogged = YES;

// However, we cannot do it right now: the views were just mounted but pixels
// were not drawn on the screen yet.
// They will be drawn for sure before the next tick of the main run loop.
// Let's wait for that and then report.
dispatch_async(dispatch_get_main_queue(), ^{
double currentTime = [[NSDate date] timeIntervalSince1970] * 1000; // Current time in milliseconds
double diffTime = 0;
Expand All @@ -71,6 +65,7 @@ - (void)didMoveToWindow {
@"diffTime": @(diffTime),
@"tagName": self->_tagName
});
[[PerformanceTrackerWriter sharedInstance] writeLogsWithTag: self.tagName time: currentTime];
});
}

Expand Down

0 comments on commit 9903c44

Please # to comment.