| 52 | bool DebugTimer::singleMode() { return m_singleMode; } |
| 53 | |
| 54 | void DebugTimer::log(const QString &msg, const char *function, const char *file, int line) |
| 55 | { |
| 56 | if(f.isOpen()) { |
| 57 | QTextStream stream(&f); |
| 58 | |
| 59 | stream << QDateTime::currentDateTime().toString("yyyy:MM:dd hh:mm:ss.zzz") << "\t" << file << ":" |
| 60 | << line << "\t" << function << "\t" << msg << "\t" << m_timer.elapsed() << "\t" |
| 61 | << "ms" |
| 62 | << "\n"; |
| 63 | } else { |
| 64 | QMessageLogger(file, line, function).info(CAT_BENCHMARK) |
| 65 | << function << msg << m_timer.elapsed() << "ms"; |
| 66 | } |
| 67 | |
| 68 | if(m_singleMode) { |
| 69 | m_timer.restart(); |
| 70 | } |
| 71 | } |
no test coverage detected