| 120 | } |
| 121 | |
| 122 | long long int timeFileWrite(const std::filesystem::path& filePath, vector<char>& content) { |
| 123 | ofstream _file; |
| 124 | LARGE_INTEGER StartingTime, EndingTime, ElapsedMicroseconds; |
| 125 | LARGE_INTEGER Frequency; |
| 126 | |
| 127 | QueryPerformanceFrequency(&Frequency); |
| 128 | |
| 129 | _file.open(filePath, ios::out | ios::binary); |
| 130 | |
| 131 | QueryPerformanceCounter(&StartingTime); |
| 132 | _file << content.data(); |
| 133 | QueryPerformanceCounter(&EndingTime); |
| 134 | |
| 135 | _file.close(); |
| 136 | |
| 137 | filesystem::remove(filePath); |
| 138 | |
| 139 | ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart; |
| 140 | ElapsedMicroseconds.QuadPart *= 1000000; |
| 141 | ElapsedMicroseconds.QuadPart /= Frequency.QuadPart; |
| 142 | return ElapsedMicroseconds.QuadPart; |
| 143 | } |
| 144 | |
| 145 | int main(int argc, char** argv) |
| 146 | { |