#include #include #include #include #include using namespace std; //http://blog.naver.com/power2845?Redirect=Log&logNo=50150861203 //http://cafe.naver.com/cafec/138386 typedef unsigned char BYTE; // 1 byte typedef unsigned short WORD; // 2 byte typedef unsigned long DWORD; // 4 byte //http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx typedef long LONG; //http://kldp.org/node/40411 typedef signed long long int INT64; typedef __int64 LONGLONG; //#if !defined(_M_IX86) // typedef __int64 LONGLONG; //#else // typedef double LONGLONG; //#endif //http://msdn.microsoft.com/en-us/library/windows/desktop/aa383713(v=vs.85).aspx //typedef __int64 _LARGE_INTEGER; //http://blog.naver.com/elastica?Redirect=Log&logNo=50045367653 //typedef union _LARGE_INTEGER { // struct { // DWORD LowPart; LONG HighPart; // }; // struct { // DWORD LowPart; LONG HighPart; // } u; // LONGLONG QuadPart; //} LARGE_INTEGER, // *PLARGE_INTEGER; // SYSTEMTIME st; // GetLocalTime(&st); LARGE_INTEGER t_start, t_end, t_tick, t_diff; DWORD dwStart, dwEnd, dwTick; void fn_start_timer() { dwStart = GetTickCount(); QueryPerformanceCounter(&t_start); } double fn_end_timer() { double timeSecond; QueryPerformanceCounter(&t_end); QueryPerformanceFrequency(&t_tick); t_diff.QuadPart = t_end.QuadPart - t_start.QuadPart; timeSecond = (double) ((double)t_diff.QuadPart/(double)t_tick.QuadPart); dwEnd = GetTickCount(); dwTick = dwEnd - dwStart; // TRACE ("Elapsed CPU time: %3.12f sec / ticksPerSecond: %I64Ld\n", timeSecond, t_diff.QuadPart); printf ("CPU time: %5.12f sec / ticksPerSecond: %11I64Ld / Tick: %5ld\n", timeSecond, t_diff.QuadPart, dwTick); return timeSecond; } /* http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=50&MAEULNO=20&no=907909&ref=907903 http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=50&MAEULNO=20&no=880255&ref=880252 http://msdn.microsoft.com/en-us/library/85zk715d(v=vs.80).aspx http://choopa.tistory.com/77 http://netmaid.tistory.com/28 http://netmaid.tistory.com/32 http://blog.naver.com/pure_evil?Redirect=Log&logNo=60164982151 http://blog.naver.com/s42467490?Redirect=Log&logNo=70146408983 http://neptjuno.tistory.com/58 http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040101&docId=67862169&qb=SU5UNjRfQw==&enc=utf8§ion=kin&rank=2&search_sort=0&spq=0&pid=RCGcOF5Y7tlsstFEcLKssssssuN-081634&sid=Uk4FmnJvLDIAAFYCCDY http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040101&docId=140375167&qb=SU5UNjRfQw==&enc=utf8§ion=kin&rank=1&search_sort=0&spq=0&pid=RCGcOF5Y7tlsstFEcLKssssssuN-081634&sid=Uk4FmnJvLDIAAFYCCDY http://msdn.microsoft.com/en-us/library/s3f49ktz(v=vs.80).aspx http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040101&docId=181013316&qb=SU5UNjRfQw==&enc=utf8§ion=kin&rank=3&search_sort=0&spq=0&pid=RCGcOF5Y7tlsstFEcLKssssssuN-081634&sid=Uk4FmnJvLDIAAFYCCDY http://cafe.naver.com/gogoomas/273826 http://cafe.naver.com/crazygm/88759 http://cafe.naver.com/cafec/58156 http://cafe.naver.com/crazygm/88849 http://cafe.naver.com/cafec/160998 */ int main(int argc, char *argv[]) { //push_front() fn_start_timer(); deque dq; int i=0; for(i=0; i<10000; i++) { dq.push_front(i); } fn_end_timer(); printf("dq size %d\n", dq.size()); printf("\n"); //°ª ³Ö±â fn_start_timer(); for(i=0; i<10000; i++) { dq[i] = i; } fn_end_timer(); printf("dq size %d\n", dq.size()); printf("\n"); //pop_front() fn_start_timer(); for(i=0; i<10000; i++) { dq.pop_front(); } fn_end_timer(); printf("dq size %d\n", dq.size()); printf("\n"); printf("__int64 size %d\n", sizeof(__int64)); printf("INT64 size %d\n", sizeof(INT64)); printf("DWORD size %d\n", sizeof(DWORD)); printf("LARGE_INTEGER size %d\n", sizeof(LARGE_INTEGER)); system("PAUSE"); return EXIT_SUCCESS; } /* CPU time: 0.000322850194 sec / ticksPerSecond: 602658 / Tick: 0 dq size 10000 CPU time: 0.001132499411 sec / ticksPerSecond: 2114014 / Tick: 15 dq size 10000 CPU time: 0.000133499046 sec / ticksPerSecond: 249200 / Tick: 0 dq size 0 __int64 size 8 INT64 size 8 DWORD size 4 LARGE_INTEGER size 8 */