次の例から、この正確なタイマーをVS2008、Windows XP(および最終的にはServer 2008)で動作させようとしています。
http://technology.chtsai.org/w98timer/
ただし、次のエラーが発生します。
- エラーLNK2019:未解決の外部シンボル_ imp _timeEndPeriod @ 4
 - エラーLNK2019:未解決の外部シンボル_ imp _timeGetTime @ 0
 - エラーLNK2019:未解決の外部シンボル_ imp _timeBeginPeriod @ 4
 - エラーLNK2019:未解決の外部シンボル_ imp _timeGetDevCaps @ 8
 
誰かアドバイスしてもらえますか?
WindowsでのC++の単純で正確なミリ秒のタイミングの例が必要です。
#include <stdio.h>
#include <windows.h>
#include <mmsystem.h>
#include "stdafx.h"
void 
main (void)
{
  TIMECAPS resolution;
  DWORD start, finish, duration, i;
  if (timeGetDevCaps (&resolution, sizeof (TIMECAPS)) == TIMERR_NOERROR)
    {
      printf ("Minimum supported resolution = %d\n", resolution.wPeriodMin);
      printf ("Maximum supported resolution = %d\n", resolution.wPeriodMax);
    }
  if (resolution.wPeriodMin <= 1)
    {
      if (timeBeginPeriod (1) == TIMERR_NOERROR)
    {
      for (i = 100; i <= 120; i++)
        {
          start = timeGetTime ();
          while (timeGetTime () < (start + i));
          finish = timeGetTime ();
          duration = finish - start;
          printf ("expected:%d  actual:%ld\n", i, duration);
        }
      timeEndPeriod (1);
    }
    }
}