BadreNarayanan.V's Radio Weblog




Weblogs

















Microsoft Specs




Security


Personal Friend



Subscribe to "BadreNarayanan.V's Radio Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


Wednesday, November 20, 2002
 


Best Timing call  to time some FP C++  code:

Jim Stanton posted sample code on Queryperformancecounter to do the timing on wintechoffTopic,

#include <iostream>

#include <windows.h>

int DoTest()

{

int i;

i = 42;

return i*15;

}

int DummyTest()

{

return 0;

}

int main()

{

__int64 i64Start;

__int64 i64End;

__int64 i64Overhead;

__int64 i64Frequency;

__int64 i64Elapsed;

const int iIterations = 100000;

int result;

QueryPerformanceCounter((LARGE_INTEGER*)&i64Start);

for (int i = 0; i < iIterations; ++i)

result = DummyTest();

//subtract ;overhead of the loop/function call, ..

QueryPerformanceCounter((LARGE_INTEGER*)&i64End);

QueryPerformanceCounter((LARGE_INTEGER*)&i64Start);

for (int i = 0; i < iIterations; ++i)

result = DoTest();

QueryPerformanceCounter((LARGE_INTEGER*)&i64End);

i64Elapsed = (i64End - i64Start) - i64Overhead;

QueryPerformanceFrequency((LARGE_INTEGER*)&i64Frequency);

std::cout << "Time elapsed was: " << (double)i64Elapsed /

(double)i64Frequency << " seconds" << std::endl;

}

-----------------

looks cool to test the timing, huh!.

 


3:39:58 PM   comment_[]


Essential .NET:

Recently attended the 5 days intesive course on Essential .NET: Building applications and components with C# conducted by developmetor. The course was awesome. The instructor JasonW did a great job explaning the core concepts clearly, lot of examples and lot of concepts in 5 days.  I wish i could attend more trainning like these, but I cannot afford $2500 from my pocket everytime.

Learning new things is good, It gives confidence!.It gives energy!


11:24:45 AM   comment_[]


Click here to visit the Radio UserLand website. © Copyright 2003 BadreNarayanan.V.
Last update: 9/28/2003; 12:15:55 PM.
November 2002
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Oct   Dec