Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // checker.cpp : Defines the entry point for the console application.
- //
- // #include "windows.h"
- #include "stdio.h"
- #include <unistd.h>
- #include <time.h>
- inline unsigned GetTickCount()
- {
- struct timespec ts;
- clock_gettime(CLOCK_REALTIME, &ts);
- return (ts.tv_nsec / 1000000) + (ts.tv_sec * 1000);
- }
- int main(int argc, char* argv[])
- {
- int *gmem;
- int width=10000,height=10000;
- gmem=new int[width*height];
- int t0=GetTickCount();
- int x,y;
- /////////////////////// ето това парче код мерим
- for(y=0;y<height;y++){
- int ofs=width*y;
- for(x=0;x<width;x++){
- gmem[x+ofs]=(((x^y)>>4)&1);
- }
- }
- //////////////////////
- printf("t:%d ms\n",GetTickCount()-t0);
- delete []gmem;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement