: : : can someone tell me how Delphi compares to C or C++ in speed? i'm not talking about compile speed.
: : : thanks.
: : :
: : :
: : :
: : Theres a way measuring time ellapsed to complete a procedure. Its an API call, and you need two variables. For example t1 and t2.
: : Sourcecode could be like this ..
: : procedure something
: : var t1, t2: Integer;
: : begin
: : t1 := Gettickcount;
: : // Do set the start before from where you want to control ellapsed time
: : t2 := Gettickcount;
: : //Set t2 after the procedure
: : showMessage(Inttostr(t2-t1)
: : end;
: : // Youll have an answer in milliseconds.
: And as far as I know, you should not worry much about whether you code by Object Pascal or C or C++. It is more important to optimize the loops in the code, than change programming language. Delphi's graphics are normally working with very nice speed, it shouldn't be the problem either. And ASM experts can optimize the loops in Delphi even more, but usually they are nearly perfect anyway.
GetTickCount has a resolution of 1 msec, but a (standard) accuracy of +/- 50 msec. So in a way you can use it for long during performance checking. For short during stuff, one can use:
QueryPerformanceCounter and QueryPerformanceFrequency