Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. // checker.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. // #include "windows.h"
  5. #include "stdio.h"
  6. #include <unistd.h>
  7. #include <time.h>
  8.  
  9. inline unsigned GetTickCount()
  10. {
  11.     struct timespec ts;
  12.     clock_gettime(CLOCK_REALTIME, &ts);
  13.     return (ts.tv_nsec / 1000000) + (ts.tv_sec * 1000);
  14. }
  15.  
  16. int main(int argc, char* argv[])
  17. {
  18.     int  *gmem;
  19.     int width=10000,height=10000;
  20.     gmem=new int[width*height];
  21.     int t0=GetTickCount();
  22.     int x,y;
  23. /////////////////////// ето това парче код мерим
  24.     for(y=0;y<height;y++){
  25.         int ofs=width*y;
  26.         for(x=0;x<width;x++){
  27.             gmem[x+ofs]=(((x^y)>>4)&1);
  28.         }
  29.     }
  30. //////////////////////
  31.     printf("t:%d ms\n",GetTickCount()-t0);
  32.  
  33.  
  34.     delete []gmem;
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement