Created
May 6, 2013 02:20
-
-
Save hushin/5523044 to your computer and use it in GitHub Desktop.
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
xjsfl.init(this); // init xJSFL | |
;(function(){ | |
function scriptFolderURI() { | |
return fl.scriptURI.replace(/[¥/][^¥/]*?$/,"/"); | |
} | |
// use Lo-Dash | |
fl.runScript(scriptFolderURI() + "jsload/lib/lodash.compat.js"); | |
})(); | |
function benchmark(name, times, callback){ | |
var timer = new Timer(name); | |
timer.start(); | |
for (var i=0; i < times; i++){ | |
callback(); | |
} | |
timer.stop(true); | |
} | |
function deleteAllLayers() { | |
function layerCallback(layer, index) { | |
$timeline.deleteLayer(index) | |
} | |
Iterators.layers(Context.create(), layerCallback); | |
} | |
clear(); | |
benchmark("convert keyframes", 10,function(){ | |
// task | |
$timeline.convertToKeyframes(0,100); | |
deleteAllLayers(); | |
}); | |
benchmark("insert keyframes", 10,function(){ | |
// task | |
_.range(100).map(function(item){$timeline.insertKeyframe(item);}); | |
deleteAllLayers(); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment