c++ - Get elapsed time as a formatted string -
i looking simplest way calculate , display execution time of function in qt
. result should string
/qstring
in format mm:ss
.
i know can int
of milliseconds qtime
there built-in function formatting?
if have elapsed time in milliseconds (ms
), can print time in mm:ss
format in following way:
qstring out = qstring("%1:%2").arg( ms / 60000 , 2, 10, qchar('0')) .arg((ms % 60000) / 1000, 2, 10, qchar('0'));
Comments
Post a Comment