1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include <QCoreApplication>
- #include <thread>
- #include "spdlog/spdlog.h"
- #include "FmtLog/fmtlog.h"
- void printCPPTime()
- {
- std::chrono::steady_clock::time_point lastTime = std::chrono::steady_clock::now();
- long count = 0;
- while(true)
- {
- std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
-
- lastTime = now;
- count++;
- std::this_thread::sleep_for(std::chrono::milliseconds(1000));
- }
- }
- void printCTime()
- {
- std::time_t lastTime = std::time(nullptr);
- long count = 0;
- while(true)
- {
- std::time_t now = std::time(nullptr);
-
- lastTime = now;
- count++;
- std::this_thread::sleep_for(std::chrono::milliseconds(1000));
- }
- }
- int main(int argc, char *argv[])
- {
- QCoreApplication a(argc, argv);
- FMTLOG_INFO("********** Time **********");
-
- SPDLOG_INFO("********** Time **********");
-
-
- auto now = std::time(nullptr);
-
- return a.exec();
- }
|