MCPcopy Create free account
hub / github.com/bananabr/TimeException / timeFileWrite

Function timeFileWrite

TimeException.cpp:122–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122long 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
145int main(int argc, char** argv)
146{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected