Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/CNStructs.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "CNStructs.hpp"
#if defined _MSC_VER
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just #ifdef _MSC_VER should be fine here

#include <chrono>
#endif

std::string U16toU8(char16_t* src) {
try {
Expand Down Expand Up @@ -27,8 +30,7 @@ uint64_t getTime() {
gettimeofday(&tp, NULL);
return tp.tv_sec * 1000 + tp.tv_usec / 1000;
#else
time_t t;
time(&t);
return (uint64_t)t;
std::chrono::milliseconds value = std::chrono::duration_cast<std::chrono::milliseconds>((std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now())).time_since_epoch());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indentation here

return (uint64_t)(value.count());
#endif
}