Skip to content

Instantly share code, notes, and snippets.

@primalmotion
Created October 13, 2011 11:59
Show Gist options
  • Select an option

  • Save primalmotion/1284064 to your computer and use it in GitHub Desktop.

Select an option

Save primalmotion/1284064 to your computer and use it in GitHub Desktop.
@import <Foundation/CPObject.j>
toto = function()
{
for(var i = 0; i < 10000; i++);
}
@implementation Util : CPObject
+ (void)toto
{
for(var i = 0; i < 10000; i++);
}
@end
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var t0 = new Date().getTime();
toto();
var t1 = new Date().getTime();
console.log("exec time functinon: " + (t1 - t0) + "ms");
var t0 = new Date().getTime();
[Util toto];
var t1 = new Date().getTime();
console.log("exec time functinon: " + (t1 - t0) + "ms");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment