Click here to Skip to main content
15,798,200 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help with this little C program Pin
CPallini14-Sep-15 4:40
mveCPallini14-Sep-15 4:40 
SuggestionRe: Need help with this little C program Pin
David Crow14-Sep-15 5:40
David Crow14-Sep-15 5:40 
GeneralRe: Need help with this little C program Pin
Member 1197963714-Sep-15 7:10
Member 1197963714-Sep-15 7:10 
QuestionC++ lambda callbacks, how to initialize with NULL pointer ? Pin
Member 853403512-Sep-15 1:45
Member 853403512-Sep-15 1:45 
AnswerRe: C++ lambda callbacks, how to initialize with NULL pointer ? Pin
Richard Andrew x6414-Sep-15 12:36
professionalRichard Andrew x6414-Sep-15 12:36 
GeneralRe: C++ lambda callbacks, how to initialize with NULL pointer ? Pin
Member 853403514-Sep-15 22:42
Member 853403514-Sep-15 22:42 
Questiondata structure and algoritm Pin
Member 1197512010-Sep-15 11:26
Member 1197512010-Sep-15 11:26 
AnswerRe: data structure and algoritm Pin
Afzaal Ahmad Zeeshan10-Sep-15 11:41
professionalAfzaal Ahmad Zeeshan10-Sep-15 11: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 11:55
Member 1197512010-Sep-15 11:55 
QuestionRe: data structure and algoritm Pin
CPallini10-Sep-15 22:19
mveCPallini10-Sep-15 22:19 
AnswerRe: data structure and algoritm Pin
David Crow11-Sep-15 3:11
David Crow11-Sep-15 3:11 
QuestionRe: data structure and algoritm Pin
CPallini11-Sep-15 3:35
mveCPallini11-Sep-15 3:35 
AnswerRe: data structure and algoritm Pin
jschell11-Sep-15 12:08
jschell11-Sep-15 12:08 
AnswerRe: data structure and algoritm Pin
David Crow11-Sep-15 3:10
David Crow11-Sep-15 3:10 
AnswerRe: data structure and algoritm Pin
jschell11-Sep-15 12:12
jschell11-Sep-15 12:12 
Questionfreestanding Pin
Member 1194028910-Sep-15 7:16
Member 1194028910-Sep-15 7:16 
QuestionRe: freestanding Pin
Richard MacCutchan10-Sep-15 8:04
mveRichard MacCutchan10-Sep-15 8:04 
AnswerRe: freestanding Pin
Member 1194028910-Sep-15 17:05
Member 1194028910-Sep-15 17:05 
GeneralRe: freestanding Pin
Richard MacCutchan10-Sep-15 22:41
mveRichard MacCutchan10-Sep-15 22:41 
AnswerRe: freestanding Pin
David Crow11-Sep-15 3:15
David Crow11-Sep-15 3:15 
GeneralRe: freestanding Pin
Member 1194028911-Sep-15 12:57
Member 1194028911-Sep-15 12:57 
QuestionDraw and re-pos CStatic controls in CDockablePane Pin
Member 85340359-Sep-15 5:55
Member 85340359-Sep-15 5:55 
AnswerRe: Draw and re-pos CStatic controls in CDockablePane Pin
Member 853403510-Sep-15 1:50
Member 853403510-Sep-15 1:50 
QuestionCustomize filter control of CHeaderCtrl Pin
aks.9-Sep-15 5:50
aks.9-Sep-15 5:50 
AnswerRe: Customize filter control of CHeaderCtrl Pin
Richard MacCutchan10-Sep-15 0:30
mveRichard MacCutchan10-Sep-15 0: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.