Op 24-8-2011 4:09, [email protected] schreef: > Actually, how about something like this: > > class QThread > { > // ... > public: > enum TimeUnit > { > Seconds, > Milliseconds, > Microseconds > }; > > void sleep(unsigned long time, TimeUnit units); > }; > > > One could also envisage TimeUnit being in the Qt namespace rather than within > QThread if other classes might find it useful. > We already have a patch waiting that will do that. QTimeSpan defines Qt::TimeUnit (though some of the units will not be all that useful in this context, I think. Or do you really want to sleep for a number of years?) It does not support microseconds though, the lowest resolution there is milliseconds.
Personally, I think that adding this to QThread is not really needed though. I don't see what is wrong with setting the sleep period in milliseconds; sleep() should not be used all that much anyway. André _______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
