Click here to Skip to main content
15,885,366 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help with this little C program Pin
CPallini14-Sep-15 3:40
mveCPallini14-Sep-15 3:40 
SuggestionRe: Need help with this little C program Pin
David Crow14-Sep-15 4:40
David Crow14-Sep-15 4:40 
GeneralRe: Need help with this little C program Pin
Member 1197963714-Sep-15 6:10
Member 1197963714-Sep-15 6:10 
QuestionC++ lambda callbacks, how to initialize with NULL pointer ? Pin
Member 853403512-Sep-15 0:45
Member 853403512-Sep-15 0:45 
AnswerRe: C++ lambda callbacks, how to initialize with NULL pointer ? Pin
Richard Andrew x6414-Sep-15 11:36
professionalRichard Andrew x6414-Sep-15 11:36 
GeneralRe: C++ lambda callbacks, how to initialize with NULL pointer ? Pin
Member 853403514-Sep-15 21:42
Member 853403514-Sep-15 21:42 
Questiondata structure and algoritm Pin
Member 1197512010-Sep-15 10:26
Member 1197512010-Sep-15 10:26 
AnswerRe: data structure and algoritm Pin
Afzaal Ahmad Zeeshan10-Sep-15 10:41
professionalAfzaal Ahmad Zeeshan10-Sep-15 10:41 
So what is the question? If the purpose is to calculate the time taken only, then consider using the clock of <ctime> header. Then calculate the time taken to complete the task, pass different number of parameters to it and see the results.

C++
#include <iostream>
#include <ctime>

int main() {
    unsigned int start = clock();
    your_function(param); 
    std::cout << "Time taken in millisecs: " << clock()-start;
    return 0;
}


This is a native way of doing so, but I would recommend that you try using the API which so ever OS you are using, for example on Windows there are many ways to get the service of a stopwatch in Win32 or even better in Visual C++'s .NET implementation.

Above code from: http://cboard.cprogramming.com/cplusplus-programming/97572-how-do-stopwatch-cplusplus-program.html[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

GeneralRe: data structure and algoritm Pin
Member 1197512010-Sep-15 10:55
Member 1197512010-Sep-15 10:55 
QuestionRe: data structure and algoritm Pin
CPallini10-Sep-15 21:19
mveCPallini10-Sep-15 21:19 
AnswerRe: data structure and algoritm Pin
David Crow11-Sep-15 2:11
David Crow11-Sep-15 2:11 
QuestionRe: data structure and algoritm Pin
CPallini11-Sep-15 2:35
mveCPallini11-Sep-15 2:35 
AnswerRe: data structure and algoritm Pin
jschell11-Sep-15 11:08
jschell11-Sep-15 11:08 
AnswerRe: data structure and algoritm Pin
David Crow11-Sep-15 2:10
David Crow11-Sep-15 2:10 
AnswerRe: data structure and algoritm Pin
jschell11-Sep-15 11:12
jschell11-Sep-15 11:12 
Questionfreestanding Pin
Member 1194028910-Sep-15 6:16
Member 1194028910-Sep-15 6:16 
QuestionRe: freestanding Pin
Richard MacCutchan10-Sep-15 7:04
mveRichard MacCutchan10-Sep-15 7:04 
AnswerRe: freestanding Pin
Member 1194028910-Sep-15 16:05
Member 1194028910-Sep-15 16:05 
GeneralRe: freestanding Pin
Richard MacCutchan10-Sep-15 21:41
mveRichard MacCutchan10-Sep-15 21:41 
AnswerRe: freestanding Pin
David Crow11-Sep-15 2:15
David Crow11-Sep-15 2:15 
GeneralRe: freestanding Pin
Member 1194028911-Sep-15 11:57
Member 1194028911-Sep-15 11:57 
QuestionDraw and re-pos CStatic controls in CDockablePane Pin
Member 85340359-Sep-15 4:55
Member 85340359-Sep-15 4:55 
AnswerRe: Draw and re-pos CStatic controls in CDockablePane Pin
Member 853403510-Sep-15 0:50
Member 853403510-Sep-15 0:50 
QuestionCustomize filter control of CHeaderCtrl Pin
aks.9-Sep-15 4:50
aks.9-Sep-15 4:50 
AnswerRe: Customize filter control of CHeaderCtrl Pin
Richard MacCutchan9-Sep-15 23:30
mveRichard MacCutchan9-Sep-15 23:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.