VC Delphi ÄÚ´æËÙ¶È±È½Ï - VC/MFC / ·Ç¼¼ÊõÀà
VC ¿ØÖÆ̨³ÌÐò:
#include <iostream>
using namespace std;
int main()
{
const int def_buffer = 1024 * 4;
DWORD t;
BYTE b[def_buffer];
memset(b, 0, sizeof(b));
PBYTE p;
t = GetTickCount();
for(int i = 0; i < 1000000; i++)
{
PBYTE p = new BYTE[def_buffer];
memcpy(p, b, def_buffer);
delete []p;
}
t = GetTickCount() - t;
cout << "ºÄʱ = " << t << endl;
system("PAUSE");
return 0;
}
Delphi ¿ØÖÆ̨³ÌÐò:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils, Windows;
const
buf_size = 1024 * 4;
var
i: Integer;
t: Cardinal;
a: array[0..buf_size-1] of byte;
p: PByte;
begin
FillChar(a, sizeof(a), 0);
t := GetTickCount();
for i := 1 to 1000000 do
begin
GetMem(p, buf_size);
Move(a, p^, buf_size);
FreeMem(p);
end;
t := GetTickCount() - t;
Writeln('ºÄʱ = ', t);
Readln;
end.
²âÊÔ½á¹û:
VC ÏÔʾ 1400×óÓÒ
Delphi 7: 700-800 ×óÓÒ
vc Óиü¿ìµÄÄÚ´æ·ÖÅäºÍ¿¼±´º¯ÊýÂð?
VC2008 Release °æ±¾
ʹÓÃRelease°æ±¾½øÐÐÓÅ»¯...
ÔõôÓÅ»¯?
->ÉèÖÃ->c/c++ÀïÃ
Ïà¹ØÎÊ´ð£º
ÓÉÓÚ¿Í戶¶ËÓеÄÎļþ經³£¸üУ¨遠³ÌµÄ£¬²»ÊǾÖÓò網£©£¬
ËùÒÔÏë寫個×Ô動¸üÐ嵀 ³ÌÐò¡£
¿´網É쵀 ·½·¨資ÁÏ£¬ÖªµÀЩ·½·¨£¬µ«²»ÖªµÀ¾ß體Ôõô寫¡£
......
procedure RunFunction;
type
TFunc = function(A: Integer): Integer;stdcall;¡¡//ÕâÀï¸ù¾ÝDLLÀïÃ溯ÊýµÄÉùÃ÷ÐÞ¸Ä
var
......
ÓÐʲô¹¹ÏëÌÖÂÛһϡ£
ÕâÀණÎ÷Ö÷ÒªÊÇÈËÆøºÍ½çÃ滨ÉÚ,¼¼ÊõÉÏûʲôÄѵã.
ÕâÎÒÖªµÀ£¬ÄǼ¼ÊõÉϵÄÄØ£¿ÓÐûÓй¹ÏëһϸÃÔõôÉè¼Æ£¿Ö÷ÒªÊÇdelphi×ÔÉíÄܲ»Äܹ»Íê³É£¬Èôͬʱ´óÁ¿¿Í»§µÇ½£¬·´Ó¦ËÙ¶ÈÈçºÎµÈµÈ¡£
ÒýÓÃ
......
ÓÃDEDE´ò¿ªÒ»¸öDLL£¬ÕÒµ½ÐèÒªµÄº¯ÊýÁË£¬µ«ÊÇÏÔʾµÄ¶¼ÊÇ»ã±à´úÂ룬¿´²»¶®£¬¿ÒÇë¸ßÊÖפ×ã°ïæ°¡£¡
ÊÇÒ»¸öKEYPRESSÏìÓ¦º¯Êý£¬¹¦ÄÜÊÇÔÚ°´ÏÂenterºóÅжÏÊäÈëµÄ×Ö·û£¬ÎÒÏë°´ÕÕ×Ô¼ºµÄÐèÇóÌøת£¬µ«ÊÇ
ÕÒ²»µ½Î»Ö㬸ßÊÖ ......
ÇëÎÊDelphiÓÐÊ÷ÐοؼþÂð£¿
ÔõÑùʹÓã¿
Ttreeview
treeview.items.addchild(nil(Éϼ¶½Úµã),'°¸·¢Ê±·¢'(text));
raize ¿Ø¼þ°üÀïÃæÓУ¬csdnÓÐÏÂÔصÄ
²é°ïÖúTTreeViewºÍTNodeÁ½¸öÀà
TTreeView ......