Click here to Skip to main content
15,879,326 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List of error codes Pin
Blake Miller13-Feb-06 4:19
Blake Miller13-Feb-06 4:19 
AnswerRe: List of error codes Pin
James R. Twine10-Feb-06 8:53
James R. Twine10-Feb-06 8:53 
AnswerRe: List of error codes Pin
Michael Dunn10-Feb-06 11:14
sitebuilderMichael Dunn10-Feb-06 11:14 
GeneralRe: List of error codes Pin
mukherjee12410-Feb-06 22:20
mukherjee12410-Feb-06 22:20 
GeneralRe: List of error codes Pin
Spykraft10-Feb-06 22:24
Spykraft10-Feb-06 22:24 
QuestionHow to hide scrollbar? Pin
Temp8310-Feb-06 3:55
Temp8310-Feb-06 3:55 
AnswerRe: How to hide scrollbar? Pin
includeh1010-Feb-06 5:42
includeh1010-Feb-06 5:42 
QuestionSpeed again Pin
hint_5410-Feb-06 3:40
hint_5410-Feb-06 3:40 
Hi there.

Lets say that I want to see wich way of output is faster: "printf" or "cout". I would writte something like this:

#include <stdio.h>
#include <time.h>

int main( void )
{
time_t begin, end;

begin = time( NULL );

unsigned long i;

for ( i=0 ; i<4294967295 ; i++ )
printf( "%d\n", i ); // This is for printf. If I was testing cout it would be
// cout << i << endl;

end = time( NULL );

printf( "IT TOOK: %d\n", end - begin );

return 0;
}

My intention is not to test wich of those is faster but to have an algorithm to test the speed for any application. The problem with this implementation is that it is not very precise; computers work a lot faster than what can be measured with seconds. Any suggestions?

Regards.

hint_54
AnswerRe: Speed again Pin
toxcct10-Feb-06 3:45
toxcct10-Feb-06 3:45 
GeneralRe: Speed again Pin
hint_5410-Feb-06 3:55
hint_5410-Feb-06 3:55 
GeneralRe: Speed again Pin
hint_5410-Feb-06 4:07
hint_5410-Feb-06 4:07 
GeneralRe: Speed again Pin
David Crow10-Feb-06 4:24
David Crow10-Feb-06 4:24 
GeneralRe: Speed again Pin
hint_5410-Feb-06 4:28
hint_5410-Feb-06 4:28 
GeneralRe: Speed again Pin
David Crow10-Feb-06 4:36
David Crow10-Feb-06 4:36 
GeneralRe: Speed again Pin
Nemanja Trifunovic10-Feb-06 5:24
Nemanja Trifunovic10-Feb-06 5:24 
GeneralRe: Speed again Pin
hint_5410-Feb-06 6:24
hint_5410-Feb-06 6:24 
AnswerRe: Speed again Pin
Jim Crafton10-Feb-06 6:37
Jim Crafton10-Feb-06 6:37 
AnswerRe: Speed again Pin
Remco Hoogenboezem10-Feb-06 8:05
Remco Hoogenboezem10-Feb-06 8:05 
GeneralRe: Speed again Pin
hint_5410-Feb-06 8:23
hint_5410-Feb-06 8:23 
QuestionLock files over 2Gb 64 bit Pin
hardchip10-Feb-06 3:06
hardchip10-Feb-06 3:06 
AnswerRe: Lock files over 2Gb 64 bit Pin
Bob Stanneveld10-Feb-06 3:30
Bob Stanneveld10-Feb-06 3:30 
AnswerRe: Lock files over 2Gb 64 bit Pin
Joe Woodbury10-Feb-06 6:41
professionalJoe Woodbury10-Feb-06 6:41 
Questionwin32 error Pin
Spykraft10-Feb-06 2:56
Spykraft10-Feb-06 2:56 
AnswerRe: win32 error Pin
ThatsAlok13-Feb-06 21:35
ThatsAlok13-Feb-06 21:35 
QuestionHOW TO ACCESS CHILDFRAME VARIABLES INTO CHILDVIEW Pin
sourabh27231810-Feb-06 2:37
sourabh27231810-Feb-06 2:37 

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.