Click here to Skip to main content
16,006,442 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C2143: syntax error : missing '{' before ':' Pin
rp_suman15-Jul-08 4:18
rp_suman15-Jul-08 4:18 
QuestionRe: error C2143: syntax error : missing '{' before ':' Pin
rp_suman15-Jul-08 18:22
rp_suman15-Jul-08 18:22 
Questionerror C2061: syntax error : identifier 'BOOL' Pin
rp_suman14-Jul-08 17:39
rp_suman14-Jul-08 17:39 
AnswerRe: error C2061: syntax error : identifier 'BOOL' Pin
rp_suman14-Jul-08 18:12
rp_suman14-Jul-08 18:12 
AnswerRe: error C2061: syntax error : identifier 'BOOL' Pin
ThatsAlok15-Jul-08 3:38
ThatsAlok15-Jul-08 3:38 
Questionoverhead of NEW and DELETE Pin
ginjikun14-Jul-08 17:34
ginjikun14-Jul-08 17:34 
AnswerRe: overhead of NEW and DELETE Pin
kDevloper14-Jul-08 20:31
kDevloper14-Jul-08 20:31 
AnswerRe: overhead of NEW and DELETE Pin
enhzflep14-Jul-08 20:31
enhzflep14-Jul-08 20:31 
PSEUDOCODE
int *varArray[1000000];

StartNewTime = getSystemTimer();

for (i=0; i<1000000; i++)
 varArray[i] = new int;


StartDelTime = getSystemTimer();

for (i=0; i<1000000; i++)
 delete varArray[i];

endTime = getSystemTimer();

elapsedNewTime = StartDelTime - StartNewTime;
elapsedDelTime = endTime - StartDelTime;

timePerNew = (float) elapsedNewTime / 1000000.0;
timePerDel = (float) elapsedDelTime / 1000000.0;


Of course, if they were C++ objects that were calling constuctors & destructors, then the answer would be different, and you would need to have an array of 1000000 (or whatever other arbitrary number suits you) pointers to objects of the type to be investigated.

Just remember - if 1 event is too quick to time effectively, then just time a whole heap of them at once.
QuestionRe: overhead of NEW and DELETE Pin
David Crow15-Jul-08 3:29
David Crow15-Jul-08 3:29 
AnswerRe: overhead of NEW and DELETE Pin
ThatsAlok15-Jul-08 3:44
ThatsAlok15-Jul-08 3:44 
AnswerRe: overhead of NEW and DELETE Pin
Mark Salsbery15-Jul-08 6:20
Mark Salsbery15-Jul-08 6:20 
QuestionCannot print landscape with default printer Pin
tataxin14-Jul-08 14:24
tataxin14-Jul-08 14:24 
GeneralRe: Cannot print landscape with default printer Pin
tataxin14-Jul-08 20:09
tataxin14-Jul-08 20:09 
AnswerRe: Cannot print landscape with default printer Pin
Nelek14-Jul-08 21:24
protectorNelek14-Jul-08 21:24 
GeneralRe: Cannot print landscape with default printer Pin
tataxin15-Jul-08 1:10
tataxin15-Jul-08 1:10 
QuestionProcess priority Pin
locoone14-Jul-08 14:00
locoone14-Jul-08 14:00 
QuestionRe: Process priority Pin
Mark Salsbery14-Jul-08 14:04
Mark Salsbery14-Jul-08 14:04 
AnswerRe: Process priority Pin
locoone14-Jul-08 15:10
locoone14-Jul-08 15:10 
AnswerRe: Process priority Pin
tataxin14-Jul-08 15:21
tataxin14-Jul-08 15:21 
GeneralRe: Process priority Pin
locoone14-Jul-08 15:26
locoone14-Jul-08 15:26 
QuestionDesign Question: Only Bitmap or JPEG ? Pin
gabbana14-Jul-08 11:01
gabbana14-Jul-08 11:01 
AnswerRe: Design Question: Only Bitmap or JPEG ? Pin
Mark Salsbery14-Jul-08 13:40
Mark Salsbery14-Jul-08 13:40 
AnswerRe: Design Question: Only Bitmap or JPEG ? Pin
Nelek14-Jul-08 21:16
protectorNelek14-Jul-08 21:16 
GeneralRe: Design Question: Only Bitmap or JPEG ? Pin
gabbana16-Jul-08 4:37
gabbana16-Jul-08 4:37 
GeneralRe: Design Question: Only Bitmap or JPEG ? Pin
Nelek20-Jul-08 23:36
protectorNelek20-Jul-08 23:36 

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.