Advertisement
Guest User

timegettime usage example(Greek)

a guest
Dec 14th, 2010
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include"windows.h"
  2. #include"stdio.h"
  3. #include"stdlib.h"
  4.  
  5. unsigned long (*wra)();
  6.  
  7. void douleia(){
  8.     int i;
  9.     for(i=0;i<2000000000;i++);
  10.     return;
  11. }
  12.  
  13. int main(){
  14.     unsigned long arxh,telos;
  15.  
  16.     HMODULE hDLL;
  17.  
  18.     if(!(hDLL=LoadLibrary(TEXT("winmm.dll")))){
  19.         printf("Den uposthrizetai h sunarthsh\n");
  20.         system("pause");
  21.         exit(1);
  22.     }
  23.     if(!(wra=GetProcAddress(hDLL,TEXT("timeGetTime")))){
  24.         printf("Den uposthrizetai h sunarthsh\n");
  25.         system("pause");
  26.         exit(2);
  27.     }
  28.  
  29.     arxh=(*wra)();
  30.     douleia();
  31.     telos=(*wra)();
  32.     printf("Xronos: %.3f sec\n",(float)((telos-arxh)*.001));
  33.     system("pause");
  34.     return(0);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement