#include #include #include #include #include #define EE_FILEIO using namespace std; #include uint32_t msg_length_max = 30000000; int main(int argc, char* argv[]) { char* endptr = 0; long elements; if (argc > 1) { elements = strtol(argv[1], &endptr, 10); } else { elements = 70000; } list lst; deque dq; for (int j = 1; j <= elements; ++j) { lst.push_back(j*3); dq.push_back(j*2); } int fd = open("eeout", O_WRONLY); if (fd < 0) { cout << "open failed. \n"; return 0; } auto_ptr buf(new SendBuffer(8192)); buf->sock_ = fd; timeval before_tv, after_tv; struct timezone tz; Msgs msgs; gettimeofday(&before_tv, &tz); msgs.Send(buf.get(), lst, dq); gettimeofday(&after_tv, &tz); if (before_tv.tv_sec != after_tv.tv_sec) { after_tv.tv_usec += 1000000; } long diff = after_tv.tv_usec - before_tv.tv_usec; cout << "That took (microseconds) " << diff << endl; close(fd); return 1; }