[SOLVED] Test a functions speed

I have 2 functions that do the same thing, but use a different algorithm, and i would like to see which is faster.

Below is a sample of the code, which does not work, but it gives the idea of what im going for.

[lua]wordArray = string.explode( " ", content() )
– wordArray = string.split( content(), “[^%s]+” )

function printTime( event )
print( event.time )
end

wordArray:addEventListener( “timer”, printTime )[/lua]

How can i do this? [import]uid: 50514 topic_id: 20192 reply_id: 320192[/import]

This code will measure time in milliseconds.

local startTime = system.getTimer() -- do something here print("Time elapsed ", (system.getTimer() - startTime)) [import]uid: 7559 topic_id: 20192 reply_id: 80718[/import]

you can use this
http://www.mydevelopersgames.com/site/ [import]uid: 7911 topic_id: 20192 reply_id: 80726[/import]

@jstrahan thanks for that! [import]uid: 50514 topic_id: 20192 reply_id: 81193[/import]