Qt 4.8
Functions | Variables
qelapsedtimer_mac.cpp File Reference
#include "qelapsedtimer.h"
#include <sys/time.h>
#include <unistd.h>
#include <mach/mach_time.h>

Go to the source code of this file.

Functions

static qint64 absoluteToMSecs (qint64 cpuTime)
 
static qint64 absoluteToNSecs (qint64 cpuTime)
 
bool operator< (const QElapsedTimer &v1, const QElapsedTimer &v2)
 
timeval qt_gettime ()
 

Variables

static mach_timebase_info_data_t info = {0,0}
 

Function Documentation

◆ absoluteToMSecs()

static qint64 absoluteToMSecs ( qint64  cpuTime)
static

Definition at line 69 of file qelapsedtimer_mac.cpp.

Referenced by qt_gettime().

70 {
71  return absoluteToNSecs(cpuTime) / 1000000;
72 }
static qint64 absoluteToNSecs(qint64 cpuTime)

◆ absoluteToNSecs()

static qint64 absoluteToNSecs ( qint64  cpuTime)
static

Definition at line 61 of file qelapsedtimer_mac.cpp.

Referenced by absoluteToMSecs(), and qt_gettime().

62 {
63  if (info.denom == 0)
64  mach_timebase_info(&info);
65  qint64 nsecs = cpuTime * info.numer / info.denom;
66  return nsecs;
67 }
static mach_timebase_info_data_t info
__int64 qint64
Definition: qglobal.h:942

◆ operator<()

bool operator< ( const QElapsedTimer v1,
const QElapsedTimer v2 
)

Definition at line 127 of file qelapsedtimer_mac.cpp.

128 {
129  return v1.t1 < v2.t1;
130 }

◆ qt_gettime()

timeval qt_gettime ( )

Definition at line 74 of file qelapsedtimer_mac.cpp.

75 {
76  timeval tv;
77 
78  uint64_t cpu_time = mach_absolute_time();
79  uint64_t nsecs = absoluteToNSecs(cpu_time);
80  tv.tv_sec = nsecs / 1000000000ull;
81  tv.tv_usec = (nsecs / 1000) - (tv.tv_sec * 1000000);
82  return tv;
83 }
static qint64 absoluteToNSecs(qint64 cpuTime)

Variable Documentation

◆ info

mach_timebase_info_data_t info = {0,0}
static

Definition at line 60 of file qelapsedtimer_mac.cpp.

Referenced by QAbstractItemViewPrivate::_q_columnsAboutToBeRemoved(), QFileSystemModelPrivate::_q_fileSystemChanged(), _q_mapFromX509Name(), QScriptDebuggerScriptsWidgetPrivate::_q_onCurrentChanged(), QFileDialogPrivate::_q_updateOkButton(), _qt_get_directory(), absoluteToNSecs(), QFileDialog::accept(), QProcessManager::add(), MetaObjectGenerator::addClassInfo(), QFileDialogPrivate::addDefaultSuffixToFiles(), QIcon::addFile(), QDirIteratorPrivate::advance(), alert_widget(), QMainWindowLayout::animationFinished(), QJSDebuggerAgent::backtrace(), QGraphicsItemEffectSourcePrivate::boundingRect(), QScriptValue::call(), QScript::QtFunction::call(), Maemo::DBusDispatcher::callAsynchronous(), QFileSystemModelPrivate::QFileSystemNode::caseSensitive(), QProcessManager::catchDeadChildren(), cgColorForQColor(), QDockWidget::changeEvent(), QScript::QtFunction::classInfo(), QScript::QtPropertyFunction::classInfo(), QScript::QMetaObjectWrapperObject::classInfo(), QPainter::clipBoundingRect(), QPainter::clipRegion(), clone(), QAhiScreen::connect(), QAbstractSocket::connectToHostImplementation(), QScriptValue::construct(), QScriptEnginePrivate::convertValue(), QScriptEnginePrivate::create(), QPatternist::ExpressionFactory::createExpression(), currentProcessIsService(), QDB2Result::data(), QScriptDebuggerStackModel::data(), QODBCResult::data(), QFontEngineFT::defaultHintStyle(), QDeclarativeMetaType::defaultMethod(), QDeclarativeMetaType::defaultProperty(), QScriptEnginePrivate::defaultPrototype(), detectProcessorFeatures(), QGraphicsItemEffectSourcePrivate::deviceRect(), QListViewPrivate::doItemsLayout(), QIcdEngine::doRequestUpdate(), QGraphicsItemEffectSourcePrivate::draw(), QPainterPrivate::draw_helper(), drawImageReleaseData(), QGraphicsScenePrivate::drawSubtreeRecursive(), QHostInfoResult::emitResultsReady(), enumCallback(), QScriptDebuggerBackendPrivate::exception(), QScript::QtFunction::execute(), QDirPrivate::exists(), QNetworkDiskCache::expire(), QWSSoundServerPrivate::feedDevice(), QScriptDebuggerBackendPrivate::fileName(), QDirModel::fileName(), QScript::QObjectData::findWrapper(), QRasterWindowSurface::flush(), QEventDispatcherMac::flush(), Maemo::freePendingCallInfo(), QMeeGoPixmapData::fromImage(), get_device_info(), QFileInfoGatherer::getInfo(), QGLMaskTextureCache::getMask(), QFileIconProviderPrivate::getWinIcon(), QScriptEnginePrivate::hasDemarshalFunction(), QFileSystemModelPrivate::QFileSystemNode::hasInformation(), QScriptEnginePrivate::hasValidCodeBlockRegister(), QFileSystemModelPrivate::QFileSystemNode::icon(), QFileSystemModelPrivate::index(), QConfFileSettingsPrivate::initFormat(), initializeDb(), QFileDialogPrivate::initialSelection(), QGLBlurTextureCache::insertBlurTextureInfo(), interfaceListing(), QScriptEnginePrivate::isArray(), QScriptEnginePrivate::isDate(), QFileSystemModelPrivate::QFileSystemNode::isDir(), QScriptEnginePrivate::isError(), QFileSystemModelPrivate::QFileSystemNode::isFile(), QFileSystemModelPrivate::QFileSystemNode::isHidden(), isPaintOrScrollDoneEvent(), QDir::isReadable(), QScriptEnginePrivate::isRegExp(), QFileSystemModelPrivate::QFileSystemNode::isSymLink(), QFileSystemModelPrivate::QFileSystemNode::isSystem(), QToolBarAreaLayout::item(), QListModeViewBase::itemIndex(), QFileSystemModelPrivate::QFileSystemNode::lastModified(), QWizardPrivate::layoutInfoForCurrentPage(), QScriptDebuggerBackendPrivate::lineNumber(), QPixmap::load(), QFontEngineFT::loadGlyph(), loadSingleEngine(), QXcbConnection::log(), QHostInfo::lookupHost(), QScript::QObjectData::mark(), QDirModelPrivate::name(), networkChangeCallback(), QMoviePrivate::next(), QFileSystemModelPrivate::node(), QSslCertificate::operator!=(), QFileSystemModelPrivate::QFileSystemNode::operator==(), QGraphicsItemEffectSourcePrivate::paddedEffectRect(), QPatternist::XsdSchemaParser::parseAnnotation(), QPatternist::XsdSchemaParser::parseAppInfo(), QFtpDTP::parseDir(), Maemo::pendingCallFunction(), QFileSystemModelPrivate::QFileSystemNode::permissions(), QFileSystemMetaData::permissions(), QGraphicsEffectSource::pixmap(), QGraphicsItemEffectSourcePrivate::pixmap(), QAuServerWindows::playHelper(), QFileSystemModelPrivate::QFileSystemNode::populate(), QJSDebuggerAgentPrivate::positionChange(), QGLPixmapBlurFilter::processGL(), QGLPixmapDropShadowFilter::processGL(), QHostInfoCache::put(), pvrQwsDisplayClose(), QDeclarative_isFileCaseCorrect(), QFont::QFont(), QFontMetrics::QFontMetrics(), QFontMetricsF::QFontMetricsF(), QScript::qobjectProtoFuncFindChildren(), QPlainTestLogger::QPlainTestLogger(), QScriptDebuggerBackendPrivate::qsassert(), QScriptContextInfoPrivate::QScriptContextInfoPrivate(), qt_adopted_thread_watcher_function(), qt_CoCreateGuid(), qt_dispatchKeyEvent(), qt_mac_cgimage_data_free(), QFileDialogPrivate::qt_mac_filedialog_filter_proc(), qt_mac_socket_callback(), qt_mac_to_pascal_string(), qt_qhostinfo_lookup(), qt_transparent_pixel(), qt_wince_ShellExecute(), QPaintDevice::qt_x11Info(), QtWndProc(), QWin32PrintEnginePrivate::queryDefault(), QWizardHeader::QWizardHeader(), QWizardPrivate::QWizardPrivate(), QMainWindowLayout::raise(), QJpegHandlerPrivate::read(), MetaObjectGenerator::readFuncsInfo(), QJpegHandlerPrivate::readJpegHeader(), MetaObjectGenerator::readVarsInfo(), QPSQLResult::record(), QMYSQLResult::record(), QTDSDriver::record(), QMYSQLDriver::record(), QPSQLDriver::record(), QWizardPrivate::recreateLayout(), QScriptEngine::registerCustomType(), QSettings::registerFormat(), QMeeGoPixmapData::registerSharedImage(), QEventDispatcherMac::registerTimer(), QFileSystemModel::remove(), QProcessManager::remove(), QNetworkDiskCachePrivate::removeFile(), QPaintEngineExPrivate::replayClipOperations(), QAbstractItemView::reset(), QDirModelPrivate::resolvedInfo(), QPainter::restore(), QMainWindowLayoutState::restoreState(), QFileSystemModelPrivate::QFileSystemNode::retranslateStrings(), QAbstractItemView::rowsAboutToBeRemoved(), QNSOpenSavePanelDelegate::runApplicationModalPanel, QFileDialog::selectFile(), QMainWindowPrivate::separatorCursor(), QFileSystemModel::setData(), QScriptEnginePrivate::setDefaultPrototype(), QFileDialog::setDirectory(), QFileSystemModelPrivate::QFileSystemNode::size(), SoundPlayProc(), QGraphicsItemEffectSourcePrivate::styleOption(), QNativeImage::systemFormat(), QMainWindowLayout::tabChanged(), QMainWindow::tabifiedDockWidgets(), timerCallback(), timeZone(), QStyleSheetStyle::titleBarLayout(), QScriptContext::toString(), QETWidget::translatePaintEvent(), QFileSystemModelPrivate::QFileSystemNode::type(), QDirModelPrivate::type(), QDBusMetaType::typeToSignature(), QToolBarAreaLayout::unplug(), QFileSystemModelPrivate::QFileSystemNode::updateIcon(), QWizardPrivate::updateLayout(), QEventDispatcherMacPrivate::waitingObserverCallback(), QCommonListViewBase::~QCommonListViewBase(), QFileSystemModelPrivate::QFileSystemNode::~QFileSystemNode(), and QJpegHandlerPrivate::~QJpegHandlerPrivate().