Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //test method which roughly mimics how I normally fetch results
- -(NSTimeInterval)fetchResultsTest
- {
- static NSString * const selectFavorites = @"SELECT songId, title FROM songs LIMIT 50";
- NSMutableArray *fetched = [NSMutableArray array];
- FMResultSet *resultSet = [[self database] executeQuery:selectFavorites];
- NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
- while ([resultSet next])
- {
- Song *song = [Song songFromResultSet:resultSet];
- [fetched addObject:song];
- }
- NSTimeInterval end = [NSDate timeIntervalSinceReferenceDate];
- return (end - start);
- }
- -(void)runTest
- {
- NSTimeInterval processTotal = 0;
- for (int i = 0; i < 100; i++)
- {
- processTotal += [self fetchResultsTest];
- }
- NSLog(@"Average time: %f", (processTotal/100));
- }
Add Comment
Please, Sign In to add comment