Skip to content

Instantly share code, notes, and snippets.

@paristote
Created April 7, 2015 08:43
Show Gist options
  • Save paristote/2966a03af7be9ba20d22 to your computer and use it in GitHub Desktop.
Save paristote/2966a03af7be9ba20d22 to your computer and use it in GitHub Desktop.
Tests the perf of the function to convert a technical name into a natural name
-(void)testPerfOfConversionToNaturalName
{
File * file = [[File alloc] init];
file.name = @".spaces.exo.platform.home.";
NSDate * now = [NSDate date];
double beginTime = now.timeIntervalSince1970;
NSLog(@"Begin at %f", beginTime);
for (int i=0; i<1000000; i++) {
[file convertToNaturalName];
}
now = [NSDate date];
NSLog(@"End at %f", now.timeIntervalSince1970);
NSLog(@"Took %f", (now.timeIntervalSince1970 - beginTime));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment