Jump to content

Timer


Recommended Posts

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

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();

EDIT

Yes, I agree with monoceres. Take his advice. :)

Edited by cppman
Link to comment
Share on other sites

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

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 by bf2forlife
Link to comment
Share on other sites

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

You can use the AutoIt ActiveX object, but that seems rather pointless to me. And no, there aren't any AutoIt to C++ converters.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...