1 Star 0 Fork 0

子安/optimized_cplusplus

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
write_file.cpp 547 Bytes
一键复制 编辑 原始数据 按行查看 历史
子安 提交于 2021-09-26 08:24 +08:00 . 增加optimized代码
//
// Created by andrew on 2021/7/7.
//
#include <vector>
#include <iostream>
#include <fstream>
#include <ctime>
using namespace std;
struct timespec timeSnap[30000];
const unsigned long second2nsec = 1000000000;
int main(int argc, char* argv[]) {
ofstream outfile("./ou.txt", ios::trunc);
for (auto & i : timeSnap) {
clock_gettime(CLOCK_MONOTONIC, &i);
}
for (auto & t : timeSnap) {
outfile << t.tv_sec * second2nsec + t.tv_nsec;
outfile << endl;
}
outfile.close();
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/andrewgithub/optimized_cplusplus.git
git@gitee.com:andrewgithub/optimized_cplusplus.git
andrewgithub
optimized_cplusplus
optimized_cplusplus
master

搜索帮助