• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            公子周

                                     --不亂于心,不困于情
            隨筆 - 3, 文章 - 0, 評論 - 5, 引用 - 0
            數據加載中……

            高效的hash_map

            #include <iostream>
            #include <hash_map>
            #include <ctime>
            using namespace std;

            int main()
            {
            hash_map<int,int> hm;
            clock_t startx = clock();
            for(int i = 0; i < 10000000; i++)
            hm.insert(make_pair(i,i));

                     cout<<"插入"<<(double)(clock()-startx)/CLOCKS_PER_SEC<<endl;


            clock_t start = clock();
            clock_t finish;
            double totaltime;

            for(int i = 0; i < 10000000; i++)
            {
            if(hm.find(i)== hm.end())
            cout<<"Error!";
            if(i%1000000 == 0)
            {
            finish = clock();
            totaltime = (double)(finish-start)/CLOCKS_PER_SEC;
            cout<<i<<" "<< totaltime << endl;
            }
            }

            finish = clock();
            totaltime=(double)(finish-start)/CLOCKS_PER_SEC;
            cout<<"\nRuntime is: "<< totaltime << "s" << endl;
            //system("pause");
            return 0;
            }

            Release版本,debug太慢了
            插入3.715
            0 0
            1000000 0.133
            2000000 0.266
            3000000 0.399
            4000000 0.534
            5000000 0.683
            6000000 0.833
            7000000 0.999
            8000000 1.149
            9000000 1.295

            Runtime is: 1.441s

            posted on 2012-07-07 20:45 公子周 閱讀(1398) 評論(1)  編輯 收藏 引用 所屬分類: 字符串處理

            評論

            # re: 高效的hash_map  回復  更多評論   

            Good....
            2012-07-08 16:32 | eryar
            久久精品人妻中文系列| 无码任你躁久久久久久久| 国产亚洲综合久久系列| 久久精品成人免费看| 久久综合伊人77777| 日韩AV无码久久一区二区| 国产成人久久精品二区三区| 久久久久亚洲av综合波多野结衣 | 久久天天躁狠狠躁夜夜avapp| 日韩AV无码久久一区二区| 2020最新久久久视精品爱| 色欲综合久久躁天天躁蜜桃| 国产精品无码久久久久| 国产精品一久久香蕉产线看| 2021国产精品久久精品| 国产69精品久久久久9999| 久久久精品国产sm调教网站 | 国产精品久久久久久搜索| 久久精品成人欧美大片| 久久午夜无码鲁丝片午夜精品| 久久青青草原精品国产| 久久精品国产日本波多野结衣| 国产亚洲美女精品久久久| 久久电影网一区| 久久久久久狠狠丁香| 久久久久久久综合日本亚洲| 无码国产69精品久久久久网站| 亚洲国产视频久久| 久久婷婷国产剧情内射白浆| 看全色黄大色大片免费久久久 | AV色综合久久天堂AV色综合在| 久久精品国产亚洲av麻豆图片| 亚洲人AV永久一区二区三区久久| 色综合久久最新中文字幕| 久久精品国产亚洲麻豆| 国产91久久综合| 久久成人18免费网站| 午夜福利91久久福利| 久久久午夜精品| 久久精品aⅴ无码中文字字幕重口| 色狠狠久久AV五月综合|