C¼ÆËã³ÌÐòÔËÐÐʱ¼ä
#include “stdio.h”
#include “stdlib.h”
#include “time.h”
int main( void )
{
long i = 10000000L;
clock_t start, finish;
double duration;
/* ²âÁ¿Ò»¸öʼþ³ÖÐøµÄʱ¼ä*/
printf( "Time to do %ld empty loops is ", i );
start = clock();
while( i-- ) ;
finish = clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
printf( "%f seconds\n", duration );
system("pause");
}
ÔÚ±ÊÕߵĻúÆ÷ÉÏ£¬ÔËÐнá¹ûÈçÏ£º
Time to do 10000000 empty loops is 0.03000 seconds
ÔÚ±ê×¼C/C++ÖУ¬×îСµÄ¼Æʱµ¥Î»ÊÇÒ»ºÁÃë
Ïà¹ØÎĵµ£º
µ±½ñÓÐÐí¶àÃâ·ÑµÄ RDBMS£¨Relational Database Management
System£¬¹ØϵÊý¾Ý¿â¹ÜÀíϵͳ£©£¬ÆäÖÐһЩÊÇ¿ª·ÅÔ´ÂëÈí¼þ£¬ÁíһЩÊÇÉÌÒµ³§ÉÌÌṩµÄÃâ·Ñ²úÆ·¡£Èç¹ûÄúÕýÔÚʹÓà C/C++¡¢Java™¡¢.NET
»ò PHP
¿ª·¢Ó¦ÓóÌÐò£¬ÏëÑ°ÕÒÒ»ÖÖ¿É¿¿µÄÊý¾Ý·þÎñÆ÷£¬Ï£ÍûËüÖ§³ÖÏȽøµÄ¼¼Êõ¡¢¾ßÓ⻶ÏÀ©´óµÄ¿ª·¢ÈËÔ±ÉçÇø²¢ÒѾ²¿ÊðÔÚÐí¶à¹Ø¼ ......
1. static ±äÁ¿
¾²Ì¬±äÁ¿µÄÀàÐÍ ËµÃ÷·ûÊÇstatic¡£ ¾²Ì¬±äÁ¿µ±È»ÊÇÊôÓÚ¾²Ì¬´æ´¢·½Ê½£¬µ«ÊÇÊôÓÚ¾²Ì¬´æ´¢·½Ê½µÄÁ¿²»Ò»¶¨¾ÍÊǾ²Ì¬±äÁ¿¡£ ÀýÈçÍⲿ±äÁ¿ËäÊôÓÚ¾²Ì¬ ´æ´¢·½Ê½£¬µ«²»Ò»¶¨ÊǾ²Ì¬±äÁ¿£¬±ØÐëÓÉ static¼ÓÒÔ¶¨Òåºó²ÅÄܳÉΪ¾²Ì¬Íⲿ±äÁ¿£¬»ò³Æ¾²Ì¬È«¾Ö±äÁ¿¡£
2. ¾²Ì¬¾Ö²¿±äÁ¿
¾²Ì¬¾Ö²¿±äÁ¿ÊôÓÚ¾²Ì¬´æ´¢·½Ê½£¬Ëü¾ßÓÐÒÔÏ ......
ÎÒÃÇÒѾÁ˽âÈçºÎ¶¨ÒåÏß³ÌÈë¿Úµãº¯Êý¡¢µ÷ÓÃϵͳAPI´´½¨Ö´ÐÐÖ¸¶¨º¯ÊýµÄÏ̡߳£±¾½Ú½«½ÒʾÕâÒ»ÇÐÔÚϵͳÄÚ²¿ÊÇÈçºÎÍê³ÉµÄ¡£
ͼ6-1ÃèÊöÁËÏ̴߳´½¨²¢Íê³É³õʼ»¯ºóµÄ״̬¡£µ÷ÓÃCreateThread»áʹϵͳ²úÉúÒ»¸öÏß³ÌÄں˶ÔÏó£¬ÆäÒýÓüÆÊý£¨Usage count£©±»³õʼ»¯Îª2£¨´´½¨Ï̵߳Ľø³ÌºÍÏ̱߳¾Éí¶¼ÒýÓÃÁ˸ÃÄں˶ÔÏ󣩣¬ÆäËüÊôÐÔÒ²Íê³ÉÁË ......
Visual Studio°üº¬ÁË4¸ö±¾»úC/C++ÔËÐÐʱ¿âºÍ2¸öÓÃÀ´¹ÜÀíMS.NETµÄC/C++ÔËÐÐʱ¿â¡£ËùÓÐÕâЩ¿â¶¼Ö§³Ö¶àÏ̱߳à³Ì»·¾³£ºÄ¿Ç°ÒѾûÓÐרÃÅΪµ¥Ï߳̿ª·¢Éè¼ÆµÄC/C++ÔËÐÐʱ¿âÁË¡£±í6-1¶ÔÕâЩ¿â½øÐÐÁËÃèÊö£º
Libray Name
Description
LibCMt.lib
Statically linked release version of the library.
Lib ......
ÏÂÃæÁоÙÁËһЩ³£¼ûµÄ±àÒëÆ÷µÄµ÷ÓÃÔ¼¶¨
VC6:
µ÷ÓÃÔ¼¶¨ ¶ÑÕ»Çå³ý ²ÎÊý´«µÝ
__cdecl µ÷ÓÃÕß ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ
__stdcall º¯Êý ......