Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctime.h>
- #define SIZE (1000*1000)
- struct item
- {
- int key;
- void *data;
- item *next;
- };
- item *head;
- void main()
- {
- int i;
- item *p;
- time_t ts0,ts1;
- head=new item;
- p=head;
- for(i=0;i<SIZE-1;i++)
- {
- p->next=new item;
- if (p->next==NULL) printf("\nerror");
- p=p->next;
- }
- printf("\npoint0");
- ts0=time(NULL);
- for(i=0;i<600;i++)
- for(p=head;p!=NULL;p=p->next)
- p->key=0;
- printf("\npoint1");
- ts1=time(NULL);
- printf("\ntime elapsed %d (s)\n",(int)(ts1-ts0));
- scanf("%d",&i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement