Skip to content

Instantly share code, notes, and snippets.

@omorandi
Created March 13, 2012 15:36
Show Gist options
  • Save omorandi/2029449 to your computer and use it in GitHub Desktop.
Save omorandi/2029449 to your computer and use it in GitHub Desktop.
simple profiling test with Ti Mobile iOS
Ti.include('included.js');
function launch_test1() {
test1();
}
function launch_test2() {
test2();
}
launch_test1();
launch_test2();
var exports = exports || {};
function test1() {
var sum = 0;
for (var i = 0; i < 1000000; i++) {
sum = sum + Math.cos(i);
}
Ti.API.info('result 1: ' + sum);
}
var test2 = function() {
var sum = 0;
for (var i = 0; i < 1000000; i++) {
sum += Math.sin(i/1000);
}
Ti.API.info('result 2: ' + sum);
};
exports.test1 = test1;
exports.test2 = test2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment