Results 1 to 6 of 6
  1. #1
    ßlindRobe's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0

    Creating Thread Using A Timer

    can anyone give me
    Timer With create Thread in one line please

  2. #2
    Nico's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Germany :D
    Posts
    15,918
    Reputation
    1121
    Thanks
    8,617
    Quote Originally Posted by ßlindRobe View Post
    can anyone give me
    Timer With create Thread in one line please
    Go, get a C++ book.
    https://www.mpgh.net/forum/31-c-c-pro...resources.html

  3. #3
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    [highlight=c++]void SampleFunction() {
    int x = 300;
    while(x > 0)
    {
    cout << x << endl;
    x-=1;
    }
    }
    void main()
    {
    int SecondsToWait = 5;
    Sleep(SecondsToWait * 1000);
    CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) SampleFunction, NULL, 0, NULL);
    }[/highlight]

    LOL @Nico ... Do you think he will do it ?

  4. #4
    ßlindRobe's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0
    @Hassan
    I Mean Thread Made By Timer
    Timer(SampleFunction) do u understand me ??

  5. #5
    Nico's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Germany :D
    Posts
    15,918
    Reputation
    1121
    Thanks
    8,617
    Quote Originally Posted by ßlindRobe View Post
    @Hassan
    I Mean Thread Made By Timer
    Timer(SampleFunction) do u understand me ??
    Code:
    void Timer(LPTHREAD_START_ROUTINE func, int SecondsToWait)
    {
        Sleep(SecondsToWait * 1000);
        CreateThread(NULL, 0, func, NULL, 0, NULL);
    }

  6. The Following 2 Users Say Thank You to Nico For This Useful Post:

    Hassan (09-15-2011),Saltine (09-15-2011)

  7. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    I think he wants to measure execution time of a function:

    Code:
    DWORD old = timeGetTime();
    
    // exec function
    
    cout<<"execution time:"<<timeGetTime()-old;
    Ah we-a blaze the fyah, make it bun dem!

Similar Threads

  1. [Release] D-Jector Source Code(Using Create Thread Method)
    By Departure in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 3
    Last Post: 11-22-2011, 10:00 PM
  2. [Help] How To Create CrossfireHack using C++2008
    By sting312 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 11
    Last Post: 06-25-2011, 07:23 AM
  3. DLL Injection + Create Thread Wtf?
    By lilneo in forum C++/C Programming
    Replies: 7
    Last Post: 04-08-2011, 06:57 PM
  4. Replies: 2
    Last Post: 04-16-2008, 06:06 PM
  5. [C++] SpeedHacking Using Timer API
    By radnomguywfq3 in forum C++/C Programming
    Replies: 4
    Last Post: 12-01-2007, 02:38 AM