关于api(100分)

  • 主题发起人 主题发起人 cooler
  • 开始时间 开始时间
C

cooler

Unregistered / Unconfirmed
GUEST, unregistred user!
有谁能帮一下我.<br>用多媒体时钟和线程察看cpu时间片分配
 
多媒体时钟: timeSetEvent,timeKillEvent<br><br>timeSetEvent<br>The timeSetEvent function starts a specified timer event. The multimedia timer runs in its own thread. After the event is activated, it calls the specified callback function or sets or pulses the specified event object.<br><br>MMRESULT timeSetEvent(<br>&nbsp; UINT uDelay, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; UINT uResolution, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; LPTIMECALLBACK lpTimeProc, &nbsp;<br>&nbsp; DWORD dwUser, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; UINT fuEvent &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>);<br>&nbsp;<br>Parameters<br>uDelay <br>Event delay, in milliseconds. If this value is not in the range of the minimum and maximum event delays supported by the timer, the function returns an error. <br>uResolution <br>Resolution of the timer event, in milliseconds. The resolution increases with smaller values; a resolution of 0 indicates periodic events should occur with the greatest possible accuracy. To reduce system overhead, however, you should use the maximum value appropriate for your application. <br>lpTimeProc <br>Pointer to a callback function that is called once upon expiration of a single event or periodically upon expiration of periodic events. If fuEvent specifies the TIME_CALLBACK_EVENT_SET or TIME_CALLBACK_EVENT_PULSE flag, then the lpTimeProc parameter is interpreted as a handle to an event object. The event will be set or pulsed upon completion of a single event or periodically upon completion of periodic events. <br>dwUser <br>User-supplied callback data. <br>fuEvent <br>Timer event type. This parameter may include one of the following values. Value Meaning <br>TIME_ONESHOT Event occurs once, after uDelay milliseconds. <br>TIME_PERIODIC Event occurs every uDelay milliseconds. <br><br><br>The fuEvent parameter may also include one of the following values: Value Meaning <br>TIME_CALLBACK_FUNCTION When the timer expires, Windows calls the function pointed to by the lpTimeProc parameter. This is the default. &nbsp;<br>TIME_CALLBACK_EVENT_SET When the timer expires, Windows calls the SetEvent function to set the event pointed to by the lpTimeProc parameter. The dwUser parameter is ignored. &nbsp;<br>TIME_CALLBACK_EVENT_PULSE When the timer expires, Windows calls the PulseEvent function to pulse the event pointed to by the lpTimeProc parameter. The dwUser parameter is ignored. &nbsp;<br><br><br><br>Return Values<br>Returns an identifier for the timer event if successful or an error otherwise. This function returns NULL if it fails and the timer event was not created. (This identifier is also passed to the callback function.)<br><br>Remarks<br>Each call to timeSetEvent for periodic timer events requires a corresponding call to the timeKillEvent function.<br><br><br>
 
时间太久,强制结束。 &nbsp; &nbsp; wjiachun
 
后退
顶部