Click here to Skip to main content
15,399,165 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List of error codes Pin
Blake Miller13-Feb-06 4:19
MemberBlake Miller13-Feb-06 4:19 
AnswerRe: List of error codes Pin
James R. Twine10-Feb-06 8:53
MemberJames 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
Membermukherjee12410-Feb-06 22:20 
GeneralRe: List of error codes Pin
Spykraft10-Feb-06 22:24
MemberSpykraft10-Feb-06 22:24 
QuestionHow to hide scrollbar? Pin
Temp8310-Feb-06 3:55
MemberTemp8310-Feb-06 3:55 
AnswerRe: How to hide scrollbar? Pin
includeh1010-Feb-06 5:42
Memberincludeh1010-Feb-06 5:42 
QuestionSpeed again Pin
hint_5410-Feb-06 3:40
Memberhint_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
Membertoxcct10-Feb-06 3:45 
GeneralRe: Speed again Pin
hint_5410-Feb-06 3:55
Memberhint_5410-Feb-06 3:55 
GeneralRe: Speed again Pin
hint_5410-Feb-06 4:07
Memberhint_5410-Feb-06 4:07 
GeneralRe: Speed again Pin
David Crow10-Feb-06 4:24
MemberDavid Crow10-Feb-06 4:24 
GeneralRe: Speed again Pin
hint_5410-Feb-06 4:28
Memberhint_5410-Feb-06 4:28 
GeneralRe: Speed again Pin
David Crow10-Feb-06 4:36
MemberDavid Crow10-Feb-06 4:36 
GeneralRe: Speed again Pin
Nemanja Trifunovic10-Feb-06 5:24
MemberNemanja Trifunovic10-Feb-06 5:24 
GeneralRe: Speed again Pin
hint_5410-Feb-06 6:24
Memberhint_5410-Feb-06 6:24 
AnswerRe: Speed again Pin
Jim Crafton10-Feb-06 6:37
MemberJim Crafton10-Feb-06 6:37 
AnswerRe: Speed again Pin
Remco Hoogenboezem10-Feb-06 8:05
MemberRemco Hoogenboezem10-Feb-06 8:05 
GeneralRe: Speed again Pin
hint_5410-Feb-06 8:23
Memberhint_5410-Feb-06 8:23 
QuestionLock files over 2Gb 64 bit Pin
hardchip10-Feb-06 3:06
Memberhardchip10-Feb-06 3:06 
AnswerRe: Lock files over 2Gb 64 bit Pin
Bob Stanneveld10-Feb-06 3:30
MemberBob 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
MemberSpykraft10-Feb-06 2:56 
AnswerRe: win32 error Pin
ThatsAlok13-Feb-06 21:35
MemberThatsAlok13-Feb-06 21:35 
QuestionHOW TO ACCESS CHILDFRAME VARIABLES INTO CHILDVIEW Pin
sourabh27231810-Feb-06 2:37
Membersourabh27231810-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.