I am working on a project, in that i need to check the time difference, between two times, am getting time difference in milliseconds , but now i want the time difference in micro and nano seconds to get exact time difference
my code :
QDateTime oStartTime = QDateTime::currentDateTime();
// some operetions //the difference is in micro and nano seconds differ
QDateTime oEndTime = QDateTime::currentDateTime();
quint64 elapsed = oStartTime.daysTo(oEndTime)*1000*60*60*24 + oStartTime.time().msecsTo(oEndTime.time());
Above code will give me only milliseconds difference in time . I also need the micro & nano seconds. Any suggestion how to get time with micro & nano seconds also?