We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(void)insertObj { // Put some data in the table if there's not enough NSArray *allColors = [Color allInstances]; NSUInteger numPeople = [Person numberOfInstances]; NSTimeInterval date1 = [NSDate.date timeIntervalSince1970]; NSLog(@"date1:%f",date1); while (numPeople < 1000) { Person *p = [Person new]; [p save:^{ p.name = [@"xiaohong" stringByAppendingString:[@(numPeople) stringValue]];//[RandomThings randomName]; NSInteger num = numPeople; if (num >= allColors.count) { num = arc4random() % allColors.count; } Color *color = allColors[num]; p.color = color; }];
numPeople++;
} NSLog(@"date2:%f",[NSDate.date timeIntervalSince1970]); }
the output result : 2017-07-10 15:13:43.624140 FCModelTest[14829:3666710] date1:1499670823.624041 2017-07-10 15:13:58.527835 FCModelTest[14829:3666710] date2:1499670838.527774
so it takes about 15s when I save 1000 datas, Is there anything wrong ?thanks for help~
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
See #18 and #91
No branches or pull requests
(void)insertObj
{
// Put some data in the table if there's not enough
NSArray *allColors = [Color allInstances];
NSUInteger numPeople = [Person numberOfInstances];
NSTimeInterval date1 = [NSDate.date timeIntervalSince1970];
NSLog(@"date1:%f",date1);
while (numPeople < 1000) {
Person *p = [Person new];
[p save:^{
p.name = [@"xiaohong" stringByAppendingString:[@(numPeople) stringValue]];//[RandomThings randomName];
NSInteger num = numPeople;
if (num >= allColors.count) {
num = arc4random() % allColors.count;
}
Color *color = allColors[num];
p.color = color;
}];
}
NSLog(@"date2:%f",[NSDate.date timeIntervalSince1970]);
}
the output result :
2017-07-10 15:13:43.624140 FCModelTest[14829:3666710] date1:1499670823.624041
2017-07-10 15:13:58.527835 FCModelTest[14829:3666710] date2:1499670838.527774
so it takes about 15s when I save 1000 datas, Is there anything wrong ?thanks for help~
The text was updated successfully, but these errors were encountered: