函數功能:GetTickCount返回(retrieve)從操作系統啟動到現在所經過(elapsed)的毫秒數,它的返回值是DWORD.
知道了這個,這個程序也就不是什麼難事了。。。
CODE:
代碼如下:
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <stdio.h>
typedef struct node
{
int h;
int m;
int s;
}
*PTime;
void sleep(long wait);
void gettime();
int main()
{
PTime times;
int flag = 1;
char time[128];
do
{
_strtime(time); // Gets the current system time (do not include the date)
system("cls"); // clear screen
printf("OS time: %s\n",time);
gettime(times); // call gettime()
sleep(1000); // sleep 1 second
printf("已開機