当前位置: 首页 > news >正文

网站建设对接模版计算机论文

网站建设对接模版,计算机论文,辽宁省朝阳网站建设,dede网站怎么做微信小程序0. 概述 为了检查是否存在系统时间跳变#xff0c;本文使用C实现了一个简单的高精度时间日志记录小程序。该程序能够每隔指定时间#xff08;默认40毫秒#xff09;记录一次系统时间到文件中#xff0c;并具备以下功能#xff1a; 自定义时间间隔和文件名#xff1a;通…0. 概述 为了检查是否存在系统时间跳变本文使用C实现了一个简单的高精度时间日志记录小程序。该程序能够每隔指定时间默认40毫秒记录一次系统时间到文件中并具备以下功能 自定义时间间隔和文件名通过命令行参数设置时间间隔和输出文件名默认值为40毫秒和timestamps.txt。高精度定时采用std::chrono::steady_clock和sleep_until确保时间间隔的准确性避免std::this_thread::sleep_for带来的时间漂移。缓存队列使用线程安全的队列缓存时间戳减少频繁的文件I/O操作。日志轮转当日志文件大小超过100MB时自动进行日志轮转。时间跳变检测使用[TIME_JUMP]标记日志中发生的时间跳变即后续时间戳小于前一个时间戳的情况。 默认仅记录跳变前后的10个时间戳避免日志文件中充斥过多正常的时间记录突出异常事件。 1. 代码实现 #mermaid-svg-hGyI6E6DyKbNoMDy {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-hGyI6E6DyKbNoMDy .error-icon{fill:#552222;}#mermaid-svg-hGyI6E6DyKbNoMDy .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-hGyI6E6DyKbNoMDy .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-hGyI6E6DyKbNoMDy .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-hGyI6E6DyKbNoMDy .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-hGyI6E6DyKbNoMDy .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-hGyI6E6DyKbNoMDy .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-hGyI6E6DyKbNoMDy .marker{fill:#333333;stroke:#333333;}#mermaid-svg-hGyI6E6DyKbNoMDy .marker.cross{stroke:#333333;}#mermaid-svg-hGyI6E6DyKbNoMDy svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-hGyI6E6DyKbNoMDy .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-hGyI6E6DyKbNoMDy .cluster-label text{fill:#333;}#mermaid-svg-hGyI6E6DyKbNoMDy .cluster-label span{color:#333;}#mermaid-svg-hGyI6E6DyKbNoMDy .label text,#mermaid-svg-hGyI6E6DyKbNoMDy span{fill:#333;color:#333;}#mermaid-svg-hGyI6E6DyKbNoMDy .node rect,#mermaid-svg-hGyI6E6DyKbNoMDy .node circle,#mermaid-svg-hGyI6E6DyKbNoMDy .node ellipse,#mermaid-svg-hGyI6E6DyKbNoMDy .node polygon,#mermaid-svg-hGyI6E6DyKbNoMDy .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-hGyI6E6DyKbNoMDy .node .label{text-align:center;}#mermaid-svg-hGyI6E6DyKbNoMDy .node.clickable{cursor:pointer;}#mermaid-svg-hGyI6E6DyKbNoMDy .arrowheadPath{fill:#333333;}#mermaid-svg-hGyI6E6DyKbNoMDy .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-hGyI6E6DyKbNoMDy .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-hGyI6E6DyKbNoMDy .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-hGyI6E6DyKbNoMDy .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-hGyI6E6DyKbNoMDy .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-hGyI6E6DyKbNoMDy .cluster text{fill:#333;}#mermaid-svg-hGyI6E6DyKbNoMDy .cluster span{color:#333;}#mermaid-svg-hGyI6E6DyKbNoMDy div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-hGyI6E6DyKbNoMDy :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 是 否 超过100MB 未超过 开始 初始化参数 启动生产者线程 启动消费者线程 获取当前时间 推入队列 计算下一个时间点 休眠至下一个时间点 继续运行? 结束生产者线程 等待1秒 获取所有时间戳 检测时间跳变 写入日志文件 检查文件大小 进行日志轮转 继续循环 等待消费者线程结束 程序结束 1.1. 线程安全队列ThreadSafeQueue 实现了一个简单的线程安全队列类ThreadSafeQueue使用std::mutex和std::condition_variable来确保并发访问的安全性。 // Thread-safe queue for storing timestamps class ThreadSafeQueue { public:// Push a new timestamp into the queuevoid push(const std::string value) {std::lock_guardstd::mutex lock(mtx_);queue_.push(value);cv_.notify_one();}// Retrieve and clear all timestamps from the queuestd::queuestd::string popAll() {std::lock_guardstd::mutex lock(mtx_);std::queuestd::string temp;std::swap(temp, queue_);return temp;}private:std::queuestd::string queue_;std::mutex mtx_;std::condition_variable cv_; };1.2. 获取当前时间的字符串表示 使用gettimeofday获取系统当前时间并将其格式化为字符串精确到微秒。 // Function to get the current time as a formatted string std::string getCurrentTimeString() {struct timeval tv;gettimeofday(tv, nullptr);struct tm* tm_info localtime(tv.tv_sec);char buffer[64];strftime(buffer, sizeof(buffer), %Y-%m-%d %H:%M:%S, tm_info);// Append microsecondschar currentTime[100];snprintf(currentTime, sizeof(currentTime), %s.%06ld, buffer, tv.tv_usec);return std::string(currentTime); }1.3. 文件大小获取 使用stat函数获取指定文件的大小以便在日志轮转时进行判断。 // Function to get the size of a file in bytes std::size_t getFileSize(const std::string filename) {struct stat stat_buf;int rc stat(filename.c_str(), stat_buf);return rc 0 ? stat_buf.st_size : 0; }1.4. 时间戳解析 将时间戳字符串解析为自纪元以来的微秒数方便进行时间比较以检测时间跳变。 // Function to parse timestamp string to microseconds since epoch uint64_t parseTimestamp(const std::string timestamp_str) {struct tm tm_info;int microseconds 0;// Split the timestamp into datetime and microsecondssize_t dot_pos timestamp_str.find(.);if (dot_pos std::string::npos) {// If no microseconds part, parse as isif (strptime(timestamp_str.c_str(), %Y-%m-%d %H:%M:%S, tm_info) nullptr) {return 0;}} else {std::string datetime_str timestamp_str.substr(0, dot_pos);std::string micro_str timestamp_str.substr(dot_pos 1);// Parse datetime partif (strptime(datetime_str.c_str(), %Y-%m-%d %H:%M:%S, tm_info) nullptr) {return 0;}// Parse microseconds parttry {microseconds std::stoi(micro_str);} catch (...) {microseconds 0;}}time_t seconds mktime(tm_info);if (seconds -1) {return 0;}uint64_t total_microseconds static_castuint64_t(seconds) * 1000000 microseconds;return total_microseconds; }1.5. 主函数实现 主函数负责解析命令行参数启动生产者和消费者线程并控制程序的运行时间和日志轮转。 int main(int argc, char* argv[]) {// Default valuesint interval_ms 40; // Default interval of 40 millisecondsstd::string filename timestamps.txt; // Default filenameint run_time_seconds 3600; // Default run time of 1 hour (3600 seconds)const std::size_t max_file_size 100 * 1024 * 1024; // 100MB// Parse command-line argumentsfor(int i 1; i argc; i) {std::string arg argv[i];if((arg -i || arg --interval) i 1 argc) {interval_ms std::atoi(argv[i]);if(interval_ms 0) {std::cerr Invalid interval. Using default value of 40 milliseconds. std::endl;interval_ms 40;}}else if((arg -f || arg --file) i 1 argc) {filename argv[i];}else if((arg -t || arg --time) i 1 argc) {run_time_seconds std::atoi(argv[i]);if(run_time_seconds 0) {std::cerr Invalid run time. Using default value of 3600 seconds (1 hour). std::endl;run_time_seconds 3600;}}else if(arg -h || arg --help) {std::cout Usage: argv[0] [options]\n Options:\n -i, --interval milliseconds Set the time interval, default is 40 milliseconds\n -f, --file filename Set the output filename, default is timestamps.txt\n -t, --time seconds Set the run time in seconds, default is 3600 seconds (1 hour)\n -h, --help Show this help message\n;return 0;}else {std::cerr Unknown argument: arg \nUse -h or --help to see available options. std::endl;return 1;}}std::cout Time Interval: interval_ms milliseconds std::endl;std::cout Output File: filename std::endl;std::cout Run Time: run_time_seconds seconds std::endl;ThreadSafeQueue timeQueue;std::atomicbool running(true);std::atomicint file_index(1); // For log rotation// Producer thread: collects timestamps at specified intervalsstd::thread producer([timeQueue, running, interval_ms]() {using clock std::chrono::steady_clock;auto next_time clock::now();while (running.load()) {// Get current time and push to queuestd::string currentTime getCurrentTimeString();timeQueue.push(currentTime);// Calculate next time pointnext_time std::chrono::milliseconds(interval_ms);// Sleep until the next time pointstd::this_thread::sleep_until(next_time);// Adjust next_time if were behind scheduleauto now clock::now();if (now next_time) {next_time now;}}});// Consumer thread: writes timestamps to the file, handles log rotation, and detects time jumpsstd::thread consumer([timeQueue, running, filename, file_index, max_file_size]() {std::ofstream outFile(filename, std::ios::out | std::ios::app);if (!outFile.is_open()) {std::cerr Unable to open file for writing: filename std::endl;running.store(false);return;}uint64_t last_timestamp_us 0; // To store the last timestamp in microsecondswhile (running.load()) {// Wait for 1 second before writing to the filestd::this_thread::sleep_for(std::chrono::seconds(1));// Retrieve all timestamps from the queuestd::queuestd::string tempQueue timeQueue.popAll();// Write timestamps to the filewhile (!tempQueue.empty()) {std::string current_timestamp_str tempQueue.front();tempQueue.pop();uint64_t current_timestamp_us parseTimestamp(current_timestamp_str);bool time_jump false;if (last_timestamp_us ! 0 current_timestamp_us last_timestamp_us) {time_jump true;}if (time_jump) {outFile current_timestamp_str [TIME_JUMP] std::endl;} else {outFile current_timestamp_str std::endl;}last_timestamp_us current_timestamp_us;}outFile.flush(); // Ensure data is written to the file// Check if file size exceeds the maximum limitstd::size_t current_size getFileSize(filename);if (current_size max_file_size) {outFile.close();// Generate a new filename with an indexstd::ostringstream new_filename;new_filename filename . file_index;// Rename the current fileif (std::rename(filename.c_str(), new_filename.str().c_str()) ! 0) {std::cerr Failed to rotate log file. std::endl;} else {std::cout Rotated log file to new_filename.str() std::endl;}// Open a new fileoutFile.open(filename, std::ios::out | std::ios::app);if (!outFile.is_open()) {std::cerr Unable to open new file for writing: filename std::endl;running.store(false);return;}// Reset last_timestamp_us after rotationlast_timestamp_us 0;}}// Write any remaining timestamps before exitingstd::queuestd::string tempQueue timeQueue.popAll();while (!tempQueue.empty()) {std::string current_timestamp_str tempQueue.front();tempQueue.pop();uint64_t current_timestamp_us parseTimestamp(current_timestamp_str);bool time_jump false;if (last_timestamp_us ! 0 current_timestamp_us last_timestamp_us) {time_jump true;}if (time_jump) {outFile current_timestamp_str [TIME_JUMP] std::endl;} else {outFile current_timestamp_str std::endl;}last_timestamp_us current_timestamp_us;}outFile.flush();outFile.close();});std::cout Program will run for run_time_seconds seconds and then exit. std::endl;// Let the program run for the specified durationstd::this_thread::sleep_for(std::chrono::seconds(run_time_seconds));running.store(false);// Wait for threads to finishproducer.join();consumer.join();std::cout Program has ended. std::endl;return 0; }2. 编译与运行 2.1 编译 g -stdc11 -pthread -o time_logger time_logger.cpp运行 使用默认设置40毫秒间隔输出文件为timestamps.txt运行1小时 ./time_logger自定义设置例如100毫秒间隔输出文件为output.txt运行2小时 ./time_logger -i 100 -f output.txt -t 72002.2 示例日志文件 以下是日志文件timestamps.txt的一部分示例内容其中标记了时间跳变 2024-04-27 12:34:56.789123 2024-04-27 12:34:56.829456 2024-04-27 12:34:56.869789 2024-04-27 12:34:56.809012 [TIME_JUMP] 2024-04-27 12:34:56.849345 ...3. 附完整代码 // g -stdc11 -pthread -o time_logger time_logger.cpp #include iostream #include fstream #include queue #include deque #include thread #include mutex #include condition_variable #include chrono #include sys/time.h #include atomic #include string #include cstdlib #include iomanip #include sstream #include sys/stat.h// Thread-safe queue for storing timestamps class ThreadSafeQueue { public:// Push a new timestamp into the queuevoid push(const std::string value) {std::lock_guardstd::mutex lock(mtx_);queue_.push(value);cv_.notify_one();}// Retrieve and clear all timestamps from the queuestd::queuestd::string popAll() {std::lock_guardstd::mutex lock(mtx_);std::queuestd::string temp;std::swap(temp, queue_);return temp;}private:std::queuestd::string queue_;std::mutex mtx_;std::condition_variable cv_; };// Function to get the current time as a formatted string std::string getCurrentTimeString() {struct timeval tv;gettimeofday(tv, nullptr);struct tm* tm_info localtime(tv.tv_sec);char buffer[64];strftime(buffer, sizeof(buffer), %Y-%m-%d %H:%M:%S, tm_info);// Append microsecondschar currentTime[100];snprintf(currentTime, sizeof(currentTime), %s.%06ld, buffer, tv.tv_usec);return std::string(currentTime); }// Function to get the size of a file in bytes std::size_t getFileSize(const std::string filename) {struct stat stat_buf;int rc stat(filename.c_str(), stat_buf);return rc 0 ? stat_buf.st_size : 0; }// Function to parse timestamp string to microseconds since epoch uint64_t parseTimestamp(const std::string timestamp_str) {struct tm tm_info;int microseconds 0;// Split the timestamp into datetime and microsecondssize_t dot_pos timestamp_str.find(.);if (dot_pos std::string::npos) {// If no microseconds part, parse as isif (strptime(timestamp_str.c_str(), %Y-%m-%d %H:%M:%S, tm_info) nullptr) {return 0;}} else {std::string datetime_str timestamp_str.substr(0, dot_pos);std::string micro_str timestamp_str.substr(dot_pos 1);// Parse datetime partif (strptime(datetime_str.c_str(), %Y-%m-%d %H:%M:%S, tm_info) nullptr) {return 0;}// Parse microseconds parttry {microseconds std::stoi(micro_str);} catch (...) {microseconds 0;}}time_t seconds mktime(tm_info);if (seconds -1) {return 0;}uint64_t total_microseconds static_castuint64_t(seconds) * 1000000 microseconds;return total_microseconds; }int main(int argc, char* argv[]) {// Default valuesint interval_ms 40; // Default interval of 40 millisecondsstd::string filename timestamps.txt; // Default filenameint run_time_seconds 3600; // Default run time of 1 hour (3600 seconds)const std::size_t max_file_size 100 * 1024 * 1024; // 100MBbool selective_logging true; // Default: enable selective logging// Parse command-line argumentsfor(int i 1; i argc; i) {std::string arg argv[i];if((arg -i || arg --interval) i 1 argc) {interval_ms std::atoi(argv[i]);if(interval_ms 0) {std::cerr Invalid interval. Using default value of 40 milliseconds. std::endl;interval_ms 40;}}else if((arg -f || arg --file) i 1 argc) {filename argv[i];}else if((arg -t || arg --time) i 1 argc) {run_time_seconds std::atoi(argv[i]);if(run_time_seconds 0) {std::cerr Invalid run time. Using default value of 3600 seconds (1 hour). std::endl;run_time_seconds 3600;}}else if(arg --disable_selective_logging) {selective_logging false;}else if(arg -h || arg --help) {std::cout Usage: argv[0] [options]\n Options:\n -i, --interval milliseconds Set the time interval, default is 40 milliseconds\n -f, --file filename Set the output filename, default is timestamps.txt\n -t, --time seconds Set the run time in seconds, default is 3600 seconds (1 hour)\n --disable_selective_logging Disable selective logging feature\n -h, --help Show this help message\n;return 0;}else {std::cerr Unknown argument: arg \nUse -h or --help to see available options. std::endl;return 1;}}std::cout Time Interval: interval_ms milliseconds std::endl;std::cout Output File: filename std::endl;std::cout Run Time: run_time_seconds seconds std::endl;std::cout Selective Logging: (selective_logging ? Enabled : Disabled) std::endl;ThreadSafeQueue timeQueue;std::atomicbool running(true);std::atomicint file_index(1); // For log rotation// Producer thread: collects timestamps at specified intervalsstd::thread producer([timeQueue, running, interval_ms]() {using clock std::chrono::steady_clock;auto next_time clock::now();while (running.load()) {// Get current time and push to queuestd::string currentTime getCurrentTimeString();timeQueue.push(currentTime);// Calculate next time pointnext_time std::chrono::milliseconds(interval_ms);// Sleep until the next time pointstd::this_thread::sleep_until(next_time);// Adjust next_time if were behind scheduleauto now clock::now();if (now next_time) {next_time now;}}});// Consumer thread: writes timestamps to the file, handles log rotation, and detects time jumpsstd::thread consumer([timeQueue, running, filename, file_index, max_file_size, selective_logging]() {std::ofstream outFile(filename, std::ios::out | std::ios::app);if (!outFile.is_open()) {std::cerr Unable to open file for writing: filename std::endl;running.store(false);return;}uint64_t last_timestamp_us 0; // To store the last timestamp in microsecondsstd::dequestd::string recent_timestamps; // To store recent timestamps for bufferconst size_t buffer_size 10; // Number of timestamps to keep before a time jumpsize_t normal_count 0; // Counter for normal timestampsconst size_t normal_threshold 20; // Write every 20 normal timestampsbool in_jump_mode false; // Flag indicating if currently in jump modesize_t jump_remaining 0; // Number of jump-related timestamps remaining to writestd::vectorstd::string jump_buffer; // Buffer to store jump-related timestampswhile (running.load()) {// Wait for 1 second before processingstd::this_thread::sleep_for(std::chrono::seconds(1));// Retrieve all timestamps from the queuestd::queuestd::string tempQueue timeQueue.popAll();while (!tempQueue.empty()) {std::string current_timestamp_str tempQueue.front();tempQueue.pop();// Update recent_timestamps bufferrecent_timestamps.push_back(current_timestamp_str);if (recent_timestamps.size() buffer_size) {recent_timestamps.pop_front();}uint64_t current_timestamp_us parseTimestamp(current_timestamp_str);bool time_jump false;if (selective_logging last_timestamp_us ! 0 current_timestamp_us last_timestamp_us) {time_jump true;}if (selective_logging time_jump !in_jump_mode) {// Time jump detected, enter jump modein_jump_mode true;jump_remaining 10; // Number of timestamps to write after the jumpjump_buffer.clear();// Add the last 10 timestamps before the jumpfor (const auto ts : recent_timestamps) {jump_buffer.push_back(ts);}// Add the current (jump) timestampjump_buffer.push_back(current_timestamp_str);last_timestamp_us current_timestamp_us;}else if (selective_logging in_jump_mode) {// In jump mode, collect the next 10 timestampsjump_buffer.push_back(current_timestamp_str);jump_remaining--;last_timestamp_us current_timestamp_us;if (jump_remaining 0) {// Write all collected jump timestamps to file with [TIME_JUMP] flagfor (size_t i 0; i jump_buffer.size(); i) {if (i buffer_size) { // The jump timestampoutFile jump_buffer[i] [TIME_JUMP] std::endl;}else {outFile jump_buffer[i] std::endl;}}outFile.flush();jump_buffer.clear();in_jump_mode false;}}else {// Normal timestamp processingnormal_count;if (normal_count normal_threshold) {outFile current_timestamp_str std::endl;outFile.flush();normal_count 0;}last_timestamp_us current_timestamp_us;}// Check if file size exceeds the maximum limitstd::size_t current_size getFileSize(filename);if (current_size max_file_size) {outFile.close();// Generate a new filename with an indexstd::ostringstream new_filename;new_filename filename . file_index;// Rename the current fileif (std::rename(filename.c_str(), new_filename.str().c_str()) ! 0) {std::cerr Failed to rotate log file. std::endl;} else {std::cout Rotated log file to new_filename.str() std::endl;}// Open a new fileoutFile.open(filename, std::ios::out | std::ios::app);if (!outFile.is_open()) {std::cerr Unable to open new file for writing: filename std::endl;running.store(false);return;}// Reset last_timestamp_us and buffers after rotationlast_timestamp_us 0;recent_timestamps.clear();jump_buffer.clear();in_jump_mode false;normal_count 0;}}}// Handle any remaining timestamps before exitingstd::queuestd::string remainingQueue timeQueue.popAll();while (!remainingQueue.empty()) {std::string current_timestamp_str remainingQueue.front();remainingQueue.pop();// Update recent_timestamps bufferrecent_timestamps.push_back(current_timestamp_str);if (recent_timestamps.size() buffer_size) {recent_timestamps.pop_front();}uint64_t current_timestamp_us parseTimestamp(current_timestamp_str);bool time_jump false;if (selective_logging last_timestamp_us ! 0 current_timestamp_us last_timestamp_us) {time_jump true;}if (selective_logging time_jump !in_jump_mode) {// Time jump detected, enter jump modein_jump_mode true;jump_remaining 10; // Number of timestamps to write after the jumpjump_buffer.clear();// Add the last 10 timestamps before the jumpfor (const auto ts : recent_timestamps) {jump_buffer.push_back(ts);}// Add the current (jump) timestampjump_buffer.push_back(current_timestamp_str);last_timestamp_us current_timestamp_us;}else if (selective_logging in_jump_mode) {// In jump mode, collect the next 10 timestampsjump_buffer.push_back(current_timestamp_str);jump_remaining--;last_timestamp_us current_timestamp_us;if (jump_remaining 0) {// Write all collected jump timestamps to file with [TIME_JUMP] flagfor (size_t i 0; i jump_buffer.size(); i) {if (i buffer_size) { // The jump timestampoutFile jump_buffer[i] [TIME_JUMP] std::endl;}else {outFile jump_buffer[i] std::endl;}}outFile.flush();jump_buffer.clear();in_jump_mode false;}}else {// Normal timestamp processingnormal_count;if (normal_count normal_threshold) {outFile current_timestamp_str std::endl;outFile.flush();normal_count 0;}last_timestamp_us current_timestamp_us;}// Check if file size exceeds the maximum limitstd::size_t current_size getFileSize(filename);if (current_size max_file_size) {outFile.close();// Generate a new filename with an indexstd::ostringstream new_filename;new_filename filename . file_index;// Rename the current fileif (std::rename(filename.c_str(), new_filename.str().c_str()) ! 0) {std::cerr Failed to rotate log file. std::endl;} else {std::cout Rotated log file to new_filename.str() std::endl;}// Open a new fileoutFile.open(filename, std::ios::out | std::ios::app);if (!outFile.is_open()) {std::cerr Unable to open new file for writing: filename std::endl;running.store(false);return;}// Reset last_timestamp_us and buffers after rotationlast_timestamp_us 0;recent_timestamps.clear();jump_buffer.clear();in_jump_mode false;normal_count 0;}}outFile.flush();outFile.close();});std::cout Program will run for run_time_seconds seconds and then exit. std::endl;// Let the program run for the specified durationstd::this_thread::sleep_for(std::chrono::seconds(run_time_seconds));running.store(false);// Wait for threads to finishproducer.join();consumer.join();std::cout Program has ended. std::endl;return 0; }
http://www.dnsts.com.cn/news/229250.html

相关文章:

  • 房产网站建设ppt怎么做网站美工
  • 网站建设用的软件邢台信息网123
  • 邯郸哪家公司做企业网站比较专业seo描述是什么意思
  • 学院网站的系统建设方式搜索引擎优化简称seo
  • html5自适应网站模版好康的网站代码
  • 网站建设优化400报价苏州市建设工程建设中心网站
  • 有没有代做课程设计的网站广州互联网项目工作室
  • 宁波网站建设外包wordpress 角色权限表
  • 如何给网站做二维码分类目录网站大全
  • 公司网站开发费计入wordpress 当前位置 页面
  • 淘宝网站c#设计怎么做图片免费模板
  • 做网站的贴吧网站建设合同 售后维护期
  • 自己做的网站如何连接入数据库网站是请网络公司制作的请问我该怎样获得并确定网站的所有权?
  • 淮南市建设工程质量监督中心网站网站域名可以更改吗
  • 珠海网站网站建设免版权费自建网站
  • 网站可以一个人做吗网站维护内容有哪些
  • 网站设计计费百度关键词优化费用
  • 怎么免费建公司网站wordpress 如何修改主题宽度
  • 网站建设有模板吗免费咨询
  • 食品网站开发毕业设计建设通官网通
  • 重庆大足网站制作公司推荐域名和网站建设实训报告
  • 龙文网站建设psd网站
  • 沈阳医疗网站制作中国建设银行网站招聘
  • 个人网站备案内容不合格织梦图片网站模板
  • 天台县网站建设哪家好设计加盟
  • 无锡手机网站制作费用中山网站推广外包
  • 网站建设公司排行购物网站前台功能模块分析
  • 如何加强网站建设大气的建筑公司名字
  • 片网站无法显示wordpress强大的主题
  • wordpress建教学网站外贸公司取名字大全集