bf2forlife Posted June 28, 2008 Share Posted June 28, 2008 So i want to know how many milliseconds it will take to complete an function, how i could do that? Link to comment Share on other sites More sharing options...
cppman Posted June 28, 2008 Share Posted June 28, 2008 So i want to know how many milliseconds it will take to complete an function, how i could do that?You call TimerInit before you call your function. Then after you call your function call TimerDiff. $timer = TimerInit() ; do your code here $time_it_took = TimerDiff($timer) Miva OS Project Link to comment Share on other sites More sharing options...
bf2forlife Posted June 28, 2008 Author Share Posted June 28, 2008 Thanks, but someone said that C++ would be faster than autoit with same function, is it true? (dont understand c++) Link to comment Share on other sites More sharing options...
cppman Posted June 28, 2008 Share Posted June 28, 2008 Thanks, but someone said that C++ would be faster than autoit with same function, is it true? (dont understand c++)Yes, C++ will be faster (depending on the function). Miva OS Project Link to comment Share on other sites More sharing options...
bf2forlife Posted June 28, 2008 Author Share Posted June 28, 2008 Will this script be faster? $timer = TimerInit() FilewriteLine("Output.txt","test") $time_it_took = TimerDiff($timer) Msgbox(0,"lol",$time_it_took) And can you also convert this to c++ so i could test it by myself Link to comment Share on other sites More sharing options...
cppman Posted June 28, 2008 Share Posted June 28, 2008 (edited) Generally speaking, no matter what you do, C++ will be faster simply because it doesn't have to interpret your code.__int64 start, finish, freq; QueryPerformanceFrequency((LARGE_INTEGER *)&freq); QueryPerformanceCounter((LARGE_INTEGER *)&start); // start time // I didn't feel like using the windows api, it may be faster - it's too much work std::fstream file("output.txt", std::ios::out); file << "test"; file.close(); // end time QueryPerformanceCounter((LARGE_INTEGER *)&finish); float diff = (((float)finish - start) / (float)freq * 1000.0f); std::cout << diff << "ms"; std::cin.get();EDITYes, I agree with monoceres. Take his advice. Edited June 28, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
monoceres Posted June 28, 2008 Share Posted June 28, 2008 Will this script be faster? $timer = TimerInit() FilewriteLine("Output.txt","test") $time_it_took = TimerDiff($timer) Msgbox(0,"lol",$time_it_took) And can you also convert this to c++ so i could test it by myself I strongly suggest that you learn some c++ before digging into this. Because I seriously doubt that you will be able to understand the process of modifying c++ code -> setting up a compiler environment -> compiling the code into a usable dll file -> calling the dll in autoit with data types, when you don't even know what c++ is And if you don't even know what you are doing then the process is totally useless as you will need assistance for every step you take. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
bf2forlife Posted June 29, 2008 Author Share Posted June 29, 2008 (edited) ive heard that when u put some autoit files in the project, then u can use AU3_ to use autoit in the c++ script, will it be faster then? And are there any autoIT > c++ conveters? Thanks Edited June 29, 2008 by bf2forlife Link to comment Share on other sites More sharing options...
cppman Posted June 29, 2008 Share Posted June 29, 2008 ive heard that when u put some autoit files in the project, then u can use AU3_ to use autoit in the c++ script, will it be faster then? And are there any autoIT > c++ conveters? ThanksYou can use the AutoIt ActiveX object, but that seems rather pointless to me. And no, there aren't any AutoIt to C++ converters. Miva OS Project Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now