From 12290857812bab2c5d50bc84932b9c4bcc9b6b6c Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Wed, 18 Sep 2024 17:18:18 +0800 Subject: [PATCH] update --- src/main.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 6e2b273..6b93b2b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,9 +1,11 @@ #include +#include #include #include #include #include #include +#include #include #include #include @@ -66,11 +68,29 @@ void reverseComplement(std::array &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 (end-start); + zt::print("[",name,"]"," Stop timing , using ", dur); + } +}; + int main() { try{ // std::ios_base::sync_with_stdio(false); //加了没效果 using namespace std; + + Spent all_spent("all spent"); + + const auto start = chrono::system_clock::now(); std::array buf; int lines = 0; @@ -83,6 +103,7 @@ int main() OPEN_OFS_AND_CHECK(output_path, output_file_stream) // string l = ""; + zt::print("Undergoing transformation\n"); while (input_file_stream.getline(buf.data(),MAX_SIZE,'\n')) {