Loading png vs bmp

BlitzPlus Forums/BlitzPlus Programming/Loading png vs bmp

Yikes..

I'm a good programmer. You'll notice me pimping my game in my signature, but I'm new to blitz.

I say this because my results were pretty startling and I'm not going to be surprised if one of you more experiecenced blitzers tells me that I did something wrong.

My test code is this
;---
Graphics 800, 600
DebugLog MilliSecs()
For i = 0 To 100
imgtemp = LoadImage("C:\slug.bmp") ; or slug.png

Next
DebugLog MilliSecs()
;-------

I used the same 800x600 image saved as png, and as 24-bit bitmap. the bmp was 1.34MB, and the png was 500K.

When I did the loop 100 times. The bmp took approx 80 seconds (just less than one second per image, this is what I see in my game too). The png took only 500ms, or 1/2 second. The png was 160 times faster!?! Is that possible?

When I did the test for only 10 iterations. The bmp took approx 8 seconds and the png took 5 milliseconds.

These results seem pretty unbelivable to me. But I did it several times. Am I somehow using Millisecs() incorrectly? (I subtracted start time from end time). Or are there other blitz factors I'm unaware of. There's got to be something fishy going on because the png is 1/3 the size of the bmp, you'd think it would take at least 1/3 of the time (just to read the disk!). Perhaps blitz checks the contents of a imgVariable before loading in a new image or something?

Anyone want to use this code and verify my resluts? Is there a flaw in my reasoning?