Created
April 7, 2015 08:43
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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