save timeStamp file for FPS syncing
| 170 | |
| 171 | // save timeStamp file for FPS syncing |
| 172 | void Recorder::saveTimeStamp() |
| 173 | { |
| 174 | // TODO: handle relative path + check Windows / UNIX compat. |
| 175 | std::ofstream fout("../recordings/timeStamp.txt"); |
| 176 | if(fout.is_open()) |
| 177 | { |
| 178 | std::cout << "recording lasted " << ((timeStamps[frameID-1]-timeStamps[0])/1000.0) << " sec(s), writing timeStamp data..." << std::endl; |
| 179 | fout << "# Elapsed time in ms # \n"; |
| 180 | for(int i = 0; i<frameID; i++) |
| 181 | { |
| 182 | fout << (float)timeStamps[i]; |
| 183 | fout << '\n'; |
| 184 | } |
| 185 | } |
| 186 | else |
| 187 | { |
| 188 | std::cout << "File could not be opened." << std::endl; |
| 189 | } |
| 190 | } |