Click here to Skip to main content
15,894,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Coloring scrollbar with DrawThemeBackground Pin
_Flaviu10-Aug-15 23:57
_Flaviu10-Aug-15 23:57 
AnswerRe: Coloring scrollbar with DrawThemeBackground Pin
CPallini15-Jul-15 1:42
mveCPallini15-Jul-15 1:42 
GeneralRe: Coloring scrollbar with DrawThemeBackground Pin
_Flaviu15-Jul-15 7:08
_Flaviu15-Jul-15 7:08 
QuestionProject compiles but VS IDE shows red error lines Pin
AmbiguousName13-Jul-15 20:40
AmbiguousName13-Jul-15 20:40 
AnswerRe: Project compiles but VS IDE shows red error lines Pin
Stefan_Lang13-Jul-15 22:02
Stefan_Lang13-Jul-15 22:02 
AnswerRe: Project compiles but VS IDE shows red error lines Pin
AmbiguousName14-Jul-15 0:06
AmbiguousName14-Jul-15 0:06 
GeneralRe: Project compiles but VS IDE shows red error lines Pin
Stefan_Lang14-Jul-15 0:41
Stefan_Lang14-Jul-15 0:41 
GeneralRe: Project compiles but VS IDE shows red error lines Pin
Jochen Arndt14-Jul-15 0:53
professionalJochen Arndt14-Jul-15 0:53 
AnswerRe: Project compiles but VS IDE shows red error lines Pin
Richard MacCutchan13-Jul-15 22:13
mveRichard MacCutchan13-Jul-15 22:13 
QuestionHow to search large database without SQL or alike. Just asking. Pin
Vaclav_13-Jul-15 7:44
Vaclav_13-Jul-15 7:44 
GeneralRe: How to search large database without SQL or alike. Just asking. Pin
PIEBALDconsult13-Jul-15 8:10
mvePIEBALDconsult13-Jul-15 8:10 
AnswerRe: How to search large database without SQL or alike. Just asking. Pin
Richard MacCutchan13-Jul-15 22:11
mveRichard MacCutchan13-Jul-15 22:11 
AnswerRe: How to search large database without SQL or alike. Just asking. Pin
jschell15-Jul-15 10:36
jschell15-Jul-15 10:36 
QuestionAssembly in C Emu8086 branch table Pin
a random user11-Jul-15 2:46
a random user11-Jul-15 2:46 
AnswerRe: Assembly in C Emu8086 branch table Pin
Daniel Pfeffer11-Jul-15 9:12
professionalDaniel Pfeffer11-Jul-15 9:12 
QuestionMFC dialog based application Pin
Member 1182280710-Jul-15 2:37
Member 1182280710-Jul-15 2:37 
QuestionRe: MFC dialog based application Pin
David Crow10-Jul-15 2:59
David Crow10-Jul-15 2:59 
AnswerRe: MFC dialog based application Pin
Richard MacCutchan10-Jul-15 4:15
mveRichard MacCutchan10-Jul-15 4:15 
QuestionHow do I add Thread in Dll Pin
AmbiguousName9-Jul-15 22:12
AmbiguousName9-Jul-15 22:12 
QuestionEstimate time of execution c-function execution Pin
CodingStyle7-Jul-15 5:08
CodingStyle7-Jul-15 5:08 
Hello all!
I need help. I need to estimate function execution time in under Linux OS. I guess that it's right way to estimate code/algorithm performance.

I'm trying, something like this:
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
void test(){
	int i;int s=0;

	for(i=1; i<1000000; i++){s+=sin(i)/i;}
}
float timedifference_msec(struct timeval t0, struct timeval t1)
{
    return (t1.tv_sec - t0.tv_sec) * 1000.0f + (t1.tv_usec - t0.tv_usec) / 1000.0f;
}

int main(void)
{
	struct timeval t0;
	struct timeval t1;
	float elapsed;
	gettimeofday(&t0, 0);
	f1();
	gettimeofday(&t1, 0);
	elapsed = timedifference_msec(t0, t1);
	printf("Code executed in %f milliseconds.\n", elapsed);
	return 0;
}

. But It's wall clock, I'm not sure that I can estimate performance by this way, besides, I need approach which will allow to measure time of each function which I choose. I've heard that there is approach to use CPU-time.
AnswerRe: Estimate time of execution c-function execution Pin
Richard MacCutchan7-Jul-15 6:31
mveRichard MacCutchan7-Jul-15 6:31 
AnswerRe: Estimate time of execution c-function execution Pin
Jochen Arndt7-Jul-15 6:35
professionalJochen Arndt7-Jul-15 6:35 
AnswerRe: Estimate time of execution c-function execution Pin
Dr. Fry7-Jul-15 10:04
Dr. Fry7-Jul-15 10:04 
AnswerRe: Estimate time of execution c-function execution Pin
CodingStyle8-Jul-15 0:02
CodingStyle8-Jul-15 0:02 
AnswerRe: Estimate time of execution c-function execution Pin
Arthur V. Ratz13-Aug-15 19:29
professionalArthur V. Ratz13-Aug-15 19:29 

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.