Без названия
Публично отправил Гость в 20:43 28-01-2012 с типом cpp и размером 0.74 KbХранить: Вечно, просмотров: 13
В буфер! | Скачать!
- #include <time.h>
- #include <iostream>
- #include <unistd.h>
- //#include <stdlib.h>
- //#include <stdio.h>
- //#include <sys/stat.h>
- #include <fcntl.h>
- #include <fstream>
- #define SIZE 5242880
- using namespace std;
- int main()
- {
- //time_t T=clock();
- char buf[SIZE];
- //char s;
- //ifstream in;
- //in.open("output");
- //in>>s;
- //cout<<"s="<<s;
- int fd = open("output", O_RDONLY);
- cout<<fd<<endl;
- time_t T = clock();
- for(int i=0; i<100; i++)
- {
- ssize_t r = read (fd, buf, SIZE);
- }
- //t = clock()-t;
- close(fd);
- for(int i=0; i<10; i++)
- cout<<buf[i]<<' ';
- cout<<endl;
- //cout<<t<<endl;
- cout<<"speed = "<<endl;
- cout<<(clock() - T)<<endl;
- }
Комментируй
Исходный текст
aml