@ 2012-06-16 @
- 1 timeGetTime();
- 2 Win32API/ GetLocalTime(...);
|
1 timeGetTime(); #
* ½Ã°£´Ù·ç±â ;
http://www.gpgstudy.com/gpgiki/%BD%C3%B0%A3%20%B4%D9%B7%E7%B1%E2#heading15
timeGetTime()
#pragma comment(lib, "winmm.lib")
#include <mmsystem.h>
GetTickCount()
#include <Windows.h>
QueryPerformanceFrequency()
QueryPerformanceCounter()- ¸î¸î CPU¿¡¼± Ŭ·°ÀÌ °Ç³Ê¶Ú´Ù´Â º¸°í°¡ ÀÖÀ½...
CPU Ŭ·°¿¡ »ó°üÀÌ ¾ø´Â timeGetTime()ÇÔ¼ö¸¦ »ç¿ë
2 Win32API/ GetLocalTime(...); #
@ 2012-06-15 @
¢¹ Á¤ÀÇ
¿øÇü | VOID GetLocalTime( LPSYSTEMTIME lpSystemTime ); |
MFC ¿øÇü | struct tm * CTime::GetLocalTime( struct tm * ptm = NULL ) const; |
GetLocalTime( ... ); | ·ÎÄà ½Ã°£À» ±¸ÇÑ´Ù. |
SetLocalTime( ... ); | ·ÎÄà ½Ã°£À» º¯°æÇÑ´Ù. |
| ·ÎÄà ½Ã°£À̶õ ½Ã½ºÅÛÀÌ À¯ÁöÇÏ´Â ½Ã½ºÅÛ ½Ã°£(UTC : Universal Time Coordinated)¿¡¼ ÇöÀç ÄÄÇ»ÅÍ°¡ ½ÇÇàµÇ°í ÀÖ´Â ½Ã°£´ë¿Í Àϱ¤ Àý¾à ½Ã°£À» °è»êÇÏ¿© º¯È¯ÇÑ ½Ã°£ÀÌ´Ù. ´ëÇѹα¹ÀÇ ·ÎÄà ½Ã°£Àº UTC ½Ã°£º¸´Ù 9½Ã°£ ´õ ºü¸£¹Ç·Î ½Ã½ºÅÛ ½Ã°£¿¡¼ 9½Ã°£¸¸Å ´õÇØ ÁÖ¾î¾ß ·ÎÄà ½Ã°£ÀÌ ±¸ÇØÁø´Ù. ÀϹÝÀûÀ¸·Î ÇöÁö ½Ã°£À̶ó°í Çϸé ÀÌ ÇÔ¼ö·Î ±¸ÇØÁö´Â ·ÎÄà ½Ã°£À» ÀǹÌÇÑ´Ù. |
GetSystemTime( ... ); | ½Ã½ºÅÛ ½Ã°£À» ±¸ÇÑ´Ù. |
SetSystemTime( ... ); | ½Ã½ºÅÛ ½Ã°£À» º¯°æÇÑ´Ù. |
| ½Ã½ºÅÛ ½Ã°£(UTC)Àº ¼¼°è Ç¥ÁؽÃÀÌ¸ç °æµµ 0µµÀÎ ¿µ±¹ÀÇ ±×¸®´ÏÄ¡ õ¹®´ë¸¦ ±âÁØÀ¸·Î ÇÑ ½Ã°£ÀÌ´Ù. ¿ì¸®³ª¶ó ½Ã°£º¸´Ù 9½Ã°£ ´À¸®´Ù. ÀÌ ½Ã°£Àº ÇöÁö ½Ã°£ÀÌ ¾Æ´Ï¹Ç·Î ÇöÀçÀÇ ½Ã°£°ú ³¯Â¥¸¦ ¾Ë°í ½ÍÀ» ¶§´Â GetLocalTime ÇÔ¼ö¸¦ »ç¿ëÇØ¾ß ÇÑ´Ù. ´Ù±¹¾î ¹öÀüÀ» ¸¸µéÁö ¾Ê´Â ÇÑ ÀÌ ÇÔ¼ö¸¦ »ç¿ëÇÒ ÀÏÀ» º°·Î ¾ø´Ù. |
Ç÷§Æû | 95 ÀÌ»ó |
¢¹ Çìµå ÆÄÀÏ Á¤ÀÇ
// C:\... \ microsoft visual studio 8\ vc\ platformsdk\ include\ winbase.h
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
WINBASEAPI
VOID
WINAPI
GetSystemTime(
__out LPSYSTEMTIME lpSystemTime
);
WINBASEAPI
VOID
WINAPI
SetSystemTime(
__in CONST SYSTEMTIME *lpSystemTime
);
WINBASEAPI
VOID
WINAPI
GetLocalTime(
__out LPSYSTEMTIME lpSystemTime
);
WINBASEAPI
VOID
WINAPI
SetLocalTime(
__in CONST SYSTEMTIME *lpSystemTime
);
¢¹ »ç¿ë
SYSTEMTIME sysTime;
GetLocalTime( &sysTime );