update
This commit is contained in:
parent
1e74545c4a
commit
1229085781
21
src/main.cpp
21
src/main.cpp
@ -1,9 +1,11 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
|
#include <chrono>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include<fstream>
|
#include<fstream>
|
||||||
|
#include <ratio>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include<algorithm>
|
#include<algorithm>
|
||||||
@ -66,12 +68,30 @@ void reverseComplement(std::array<char, MAX_SIZE> &DNAsequence,const size_t buf_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Spent{
|
||||||
|
const decltype(std::chrono::system_clock::now()) start;
|
||||||
|
const std::string_view name;
|
||||||
|
public:
|
||||||
|
Spent(std::string_view name)noexcept:start(std::chrono::system_clock::now()),name(name){
|
||||||
|
zt::print("[",name,"]"," Start timing","\n");
|
||||||
|
}
|
||||||
|
~Spent(){
|
||||||
|
const auto end = std::chrono::system_clock::now();
|
||||||
|
const auto dur = std::chrono::duration_cast<std::chrono::milliseconds> (end-start);
|
||||||
|
zt::print("[",name,"]"," Stop timing , using ", dur);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
try{
|
try{
|
||||||
// std::ios_base::sync_with_stdio(false); //加了没效果
|
// std::ios_base::sync_with_stdio(false); //加了没效果
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
Spent all_spent("all spent");
|
||||||
|
|
||||||
|
const auto start = chrono::system_clock::now();
|
||||||
|
|
||||||
std::array<char,MAX_SIZE> buf;
|
std::array<char,MAX_SIZE> buf;
|
||||||
int lines = 0;
|
int lines = 0;
|
||||||
|
|
||||||
@ -83,6 +103,7 @@ int main()
|
|||||||
OPEN_OFS_AND_CHECK(output_path, output_file_stream)
|
OPEN_OFS_AND_CHECK(output_path, output_file_stream)
|
||||||
|
|
||||||
// string l = "";
|
// string l = "";
|
||||||
|
zt::print("Undergoing transformation\n");
|
||||||
|
|
||||||
while (input_file_stream.getline(buf.data(),MAX_SIZE,'\n'))
|
while (input_file_stream.getline(buf.data(),MAX_SIZE,'\n'))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user