Game Development Community

display the time taken by a function to load

by Yash Adukia · in iTorque 2D · 07/04/2011 (6:47 am) · 3 replies

how do I display the time taken by specific functions?
plz help coz i need to optimize the code accordingly

#1
07/04/2011 (7:29 am)
GetSimTime() will return the time in milliseconds since the game started. Just call this at the start and end of your function to see how much time elapses. Most functions will take less than a millisecond to execute though, so you might want to call your function 1000 times and see how long that takes.
#2
07/04/2011 (11:18 pm)
thanks Conor,
I'm making a game in which user will make a word and the word will be searched for in the text file which contains all the words of dictionary. So, that take sometime to search and I wanted to display that.
Also, if you can help me with a search technique which would take the least amount of time to search for the word?
#3
07/04/2011 (11:18 pm)
thanks Conor,
I'm making a game in which user will make a word and the word will be searched for in the text file which contains all the words of dictionary. So, that take sometime to search and I wanted to display that.
Also, if you can help me with a search technique which would take the least amount of time to search for the word?
#4
07/05/2011 (8:21 am)
I would suggest splitting your dictionary into chunks based on the first letter, then only search within the relevant chunks to speed up the search time.