Desandro imagesLoaded vs native img.onload

Benchmark created by Tim on


Preparation HTML

<script src="http://imagesloaded.desandro.com/imagesloaded.pkgd.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Native imag
console.time('img.onload')
var img = new Image();
img.onload = function(){
console.timeEnd('img.onload')
}
img.src = 'https://farm6.staticflickr.com/5565/14850549089_524d352208_z.jpg'
ready
imagesLoaded
console.time('imagesLoaded')
var img = new Image();
imagesLoaded(img,function(){
console.timeEnd('imagesLoaded')
})
img.src = 'https://farm6.staticflickr.com/5565/14850549089_524d352208_z.jpg'
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.