这篇教程C++ totalTime函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中totalTime函数的典型用法代码示例。如果您正苦于以下问题:C++ totalTime函数的具体用法?C++ totalTime怎么用?C++ totalTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了totalTime函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: totalTimeqint64 MediaObject::remainingTime() const{ if(currentTime() > totalTime()) return 0; return totalTime() - currentTime();}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:7,
示例2: switch/** * Set the property of this metajoint to the value passed in * * @param property The property to set * @param value The value to set it to * @return True on success */bool MetaJoint::set(PROPERTY property, double value){ double currVel; double newVia; switch (property){ case META_VALUE: position = value; break; case POSITION: case GOAL: controller->update(); if (value == interStep){ break; } currVel = (currStepCount != 0 && currParams.valid) ? (interpolateFourthOrder(currParams, currStepCount) - interpolateFourthOrder(currParams, currStepCount - 1)) : 0; if (!startParams.valid){ currStepCount = 0; totalStepCount = totalTime(interStep, value, currVel, interVel) * frequency; if (totalStepCount > 0) { startParams = initFourthOrder(interStep, currVel, (value + interStep)/2, (double)totalStepCount / 2, value, totalStepCount); currParams = startParams; } lastGoal = interStep; } else if (currStepCount != currParams.tv) { newVia = (startParams.ths + interpolateFourthOrder(currParams, currStepCount)); totalStepCount = currStepCount + (totalTime(newVia, value, currVel, interVel) * frequency); currParams = initFourthOrder( startParams.ths, currVel, newVia, currStepCount, value, totalStepCount ); } currGoal = value; break; case SPEED: case VELOCITY: if (value > 0) interVel = value; break; case READY: ready = (bool)value; break; case INTERPOLATION_STEP: currParams.valid = false; startParams.valid = false; totalStepCount = 0; currStepCount = 0; break; default: return false; } return true;}
开发者ID:RyanYoung25,项目名称:maestor,代码行数:61,
示例3: openPerfStatsFile// Dump out performance metrics over some time intervalvoid LLPerfStats::dumpIntervalPerformanceStats(){ // Ensure output file is OK openPerfStatsFile(); if ( mFrameStatsFile ) { LLSD stats = LLSD::emptyMap(); LLStatAccum::TimeScale scale; if ( getReportPerformanceInterval() == 0.f ) { scale = LLStatAccum::SCALE_PER_FRAME; } else if ( getReportPerformanceInterval() < 0.5f ) { scale = LLStatAccum::SCALE_100MS; } else { scale = LLStatAccum::SCALE_SECOND; } // Write LLSD into log stats["utc_time"] = (LLSD::String) LLError::utcTime(); stats["timestamp"] = U64_to_str((totalTime() / 1000) + (gUTCOffset * 1000)); // milliseconds since epoch stats["frame_number"] = (LLSD::Integer) LLFrameTimer::getFrameCount(); // Add process-specific frame info. addProcessFrameInfo(stats, scale); LLPerfBlock::addStatsToLLSDandReset( stats, scale ); mFrameStatsFile << LLSDNotationStreamer(stats) << std::endl; }}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:36,
示例4: slotErrorvoid PlaybackWidget::slotTimeUpdaterTimeout(){ if ( m_mediaObject->state() == Phonon::ErrorState ) { slotError(); return; } long int current = m_mediaObject->currentTime(); int hours = (int)(current / (long int)( 60 * 60 * 1000 )); int mins = (int)((current / (long int)( 60 * 1000 )) - (long int)(hours * 60)); int secs = (int)((current / (long int)1000) - (long int)(hours * 60 + mins * 60)); QTime elapsedTime(hours, mins, secs); if ( m_isZeroTime ) { m_isZeroTime = false; long int total = m_mediaObject->totalTime(); hours = (int)(total / (long int)( 60 * 60 * 1000 )); mins = (int)((total / (long int)( 60 * 1000 )) - (long int)(hours * 60)); secs = (int)((total / (long int)1000) - (long int)(hours * 60 + mins * 60)); QTime totalTime(hours, mins, secs); m_totalTimeLabel->setText(totalTime.toString("H:mm:ss")); } m_elapsedTimeLabel->setText(elapsedTime.toString("H:mm:ss"));}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:29,
示例5: totalTimevoid widget::positionChanged(qint64 position){ ui->hSlider_SongProgress->setValue(position); QTime totalTime(0,(position / 60000) % 60,(position / 1000) % 60,position%1000); ui->label_Curtime->setText(tr("%1").arg(totalTime.toString("mm:ss")));// showTime(position);}
开发者ID:UndertakerMouni,项目名称:AtticMusic,代码行数:7,
示例6: slotErrorvoid PresentationAudioWidget::slotTimeUpdaterTimeout(){ if (d->mediaObject->error() != QMediaPlayer::NoError) { slotError(); return; } qint64 current = d->mediaObject->position(); int hours = (int)(current / (qint64)(60 * 60 * 1000)); int mins = (int)((current / (qint64)(60 * 1000)) - (qint64)(hours * 60)); int secs = (int)((current / (qint64)1000) - (qint64)(hours * 60 + mins * 60)); QTime elapsedTime(hours, mins, secs); if (d->isZeroTime && d->mediaObject->duration() > 0) { d->isZeroTime = false; qint64 total = d->mediaObject->duration(); hours = (int)(total / (qint64)(60 * 60 * 1000)); mins = (int)((total / (qint64)(60 * 1000)) - (qint64)(hours * 60)); secs = (int)((total / (qint64)1000) - (qint64)(hours * 60 + mins * 60)); QTime totalTime(hours, mins, secs); m_totalTimeLabel->setText(totalTime.toString(QString::fromLatin1("H:mm:ss"))); } m_elapsedTimeLabel->setText(elapsedTime.toString(QString::fromLatin1("H:mm:ss")));}
开发者ID:birkedal,项目名称:digikam,代码行数:27,
示例7: K_Dqint64 MediaObject::totalTime() const{ K_D(const MediaObject); if (!d->m_backendObject) { return -1; } return INTERFACE_CALL(totalTime());}
开发者ID:sandsmark,项目名称:phonon-visualization-gsoc,代码行数:8,
示例8: totalTime// staticvoid LLFrameTimer::updateFrameTime(){ U64 total_time = totalTime(); sFrameDeltaTime = total_time - sTotalTime; sTotalTime = total_time; sTotalSeconds = U64_to_F64(sTotalTime) * USEC_TO_SEC_F64; sFrameTime = U64_to_F64(sTotalTime - sStartTotalTime) * USEC_TO_SEC_F64;}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:9,
示例9: totalTime// 更新timeLabel标签显示的播放时间void MyWidget::updateTime(qint64 time){ qint64 totalTimeValue = mediaObject->totalTime(); QTime totalTime(0, (totalTimeValue / 60000) % 60, (totalTimeValue / 1000) % 60); QTime currentTime(0, (time / 60000) % 60, (time / 1000) % 60); QString str = currentTime.toString("mm:ss") + " / " + totalTime.toString("mm:ss"); timeLabel->setText(str);}
开发者ID:github-jxm,项目名称:QtCrearor_fast_learn,代码行数:9,
示例10: mooseAssertvoidPerfGraph::recursivelyPrintHeaviestGraph(PerfNode * current_node, FullTable & vtable, unsigned int current_depth){ mooseAssert(!_section_time_ptrs.empty(), "updateTiming() must be run before recursivelyPrintGraph!"); auto & name = _id_to_section_name[current_node->id()]; auto section = std::string(current_depth * 2, ' ') + name; // The total time of the root node auto total_root_time = _section_time_ptrs[0]->_total; auto num_calls = current_node->numCalls(); auto self = std::chrono::duration<double>(current_node->selfTime()).count(); auto self_avg = self / static_cast<Real>(num_calls); auto self_percent = 100. * self / total_root_time; auto children = std::chrono::duration<double>(current_node->childrenTime()).count(); auto children_avg = children / static_cast<Real>(num_calls); auto children_percent = 100. * children / total_root_time; auto total = std::chrono::duration<double>(current_node->totalTime()).count(); auto total_avg = total / static_cast<Real>(num_calls); auto total_percent = 100. * total / total_root_time; vtable.addRow(section, num_calls, self, self_avg, self_percent, children, children_avg, children_percent, total, total_avg, total_percent); current_depth++; if (!current_node->children().empty()) { PerfNode * heaviest_child = nullptr; for (auto & child_it : current_node->children()) { auto current_child = child_it.second.get(); if (!heaviest_child || (current_child->totalTime() > heaviest_child->totalTime())) heaviest_child = current_child; } recursivelyPrintHeaviestGraph(heaviest_child, vtable, current_depth); }}
开发者ID:FHilty,项目名称:moose,代码行数:57,
示例11: mReplyQueueHttpOperation::HttpOperation() : LLCoreInt::RefCounted(true), mReplyQueue(NULL), mUserHandler(NULL), mReqPolicy(HttpRequest::DEFAULT_POLICY_ID), mReqPriority(0U), mTracing(HTTP_TRACE_OFF){ mMetricCreated = totalTime();}
开发者ID:Belxjander,项目名称:Kirito,代码行数:10,
示例12: totalTimeU64 LLStatAccum::getCurrentUsecs() const{ if (mUseFrameTimer) { return LLFrameTimer::getTotalTime(); } else { return totalTime(); }}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:11,
示例13: currentTimevoid Player::updateDurationInfo(qint64 currentInfo){ QString tStr; if (currentInfo || duration) { QTime currentTime((currentInfo/3600)%60, (currentInfo/60)%60, currentInfo%60, (currentInfo*1000)%1000); QTime totalTime((duration/3600)%60, (duration/60)%60, duration%60, (duration*1000)%1000); QString format = "mm:ss"; if (duration > 3600) format = "hh:mm:ss"; tStr = currentTime.toString(format) + " / " + totalTime.toString(format); } labelDuration->setText(tStr);}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:13,
示例14: mainint main(){ std::string input; std::vector<std::string> history{}; std::chrono::microseconds totalTime(0); do { std::cout << "> "; std::getline(std::cin, input); } while(execute(input, history, totalTime)); return 0;}
开发者ID:bogoli,项目名称:CS3100,代码行数:14,
示例15: currentTimevoid GrlMedia::updateDurationInfo(qint64 currentInfo){ lb_tiempo = "00:00 / 00:00"; if (currentInfo || m_duration) { QTime currentTime((currentInfo/3600)%60, (currentInfo/60)%60, currentInfo%60, (currentInfo*1000)%1000); QTime totalTime((m_duration/3600)%60, (m_duration/60)%60, m_duration%60, (m_duration*1000)%1000); QString format = "mm:ss"; if (m_duration > 3600) format = "hh:mm:ss"; lb_tiempo = currentTime.toString(format) + " / " + totalTime.toString(format); } emit timeChanged(lb_tiempo);}
开发者ID:Monthy,项目名称:gr-lida,代码行数:15,
示例16: setTitles void MediaObject::loadingFinished(MediaGraph *mg) { if (mg == currentGraph()) {#ifndef QT_NO_PHONON_MEDIACONTROLLER //Title interface m_currentTitle = 0; setTitles(currentGraph()->titles());#endif //QT_NO_PHONON_MEDIACONTROLLER HRESULT hr = mg->renderResult(); if (catchComError(hr)) { return; } if (m_oldHasVideo != currentGraph()->hasVideo()) { emit hasVideoChanged(currentGraph()->hasVideo()); }#ifndef QT_NO_PHONON_VIDEO if (currentGraph()->hasVideo()) { updateVideoGeometry(); }#endif //QT_NO_PHONON_VIDEO emit metaDataChanged(currentGraph()->metadata()); emit totalTimeChanged(totalTime()); //let's put the next state switch(m_nextState) { case Phonon::PausedState: pause(); break; case Phonon::PlayingState: play(); break; case Phonon::ErrorState: setState(Phonon::ErrorState); break; case Phonon::StoppedState: default: stop(); break; } } }
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:47,
示例17: mBufferLLReliablePacket::LLReliablePacket( S32 socket, U8* buf_ptr, S32 buf_len, LLReliablePacketParams* params) : mBuffer(NULL), mBufferLength(0){ if (params) { mHost = params->mHost; mRetries = params->mRetries; mPingBasedRetry = params->mPingBasedRetry; mTimeout = params->mTimeout; mCallback = params->mCallback; mCallbackData = params->mCallbackData; mMessageName = params->mMessageName; } else { mRetries = 0; mPingBasedRetry = TRUE; mTimeout = 0.f; mCallback = NULL; mCallbackData = NULL; mMessageName = NULL; } mExpirationTime = (F64)((S64)totalTime())/1000000.0 + mTimeout; mPacketID = ntohl(*((U32*)(&buf_ptr[PHL_PACKET_ID]))); mSocket = socket; if (mRetries) { mBuffer = new U8[buf_len]; if (mBuffer != NULL) { memcpy(mBuffer,buf_ptr,buf_len); /*Flawfinder: ignore*/ mBufferLength = buf_len; } }}
开发者ID:HizWylder,项目名称:GIS,代码行数:43,
示例18: currentGraph void MediaObject::switchToNextSource() { m_prefinishMarkSent = false; m_aboutToFinishSent = false; m_nextSourceReadyToStart = false; m_oldHasVideo = currentGraph()->hasVideo(); qSwap(m_graphs[0], m_graphs[1]); //swap the graphs if (m_transitionTime >= 0) m_graphs[1]->stop(); //make sure we stop the previous graph if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid && catchComError(currentGraph()->renderResult())) { setState(Phonon::ErrorState); return; } //we need to play the next media play(); //we tell the video widgets to switch now to the new source#ifndef QT_NO_PHONON_VIDEO for (int i = 0; i < m_videoWidgets.count(); ++i) { m_videoWidgets.at(i)->setCurrentGraph(currentGraph()->index()); }#endif //QT_NO_PHONON_VIDEO emit currentSourceChanged(currentGraph()->mediaSource()); emit metaDataChanged(currentGraph()->metadata()); if (nextGraph()->hasVideo() != currentGraph()->hasVideo()) { emit hasVideoChanged(currentGraph()->hasVideo()); } emit tick(0); emit totalTimeChanged(totalTime());#ifndef QT_NO_PHONON_MEDIACONTROLLER setTitles(currentGraph()->titles());#endif //QT_NO_PHONON_MEDIACONTROLLER }
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:43,
示例19: translateToExternalFormatvoid QueryCostInfo :: translateToExternalFormat(SQL_QUERY_COST_INFO *query_cost_info){ query_cost_info->cpuTime = cpuTime(); query_cost_info->ioTime = ioTime(); query_cost_info->msgTime = msgTime(); query_cost_info->idleTime = idleTime(); query_cost_info->totalTime = totalTime(); query_cost_info->cardinality = cardinality(); query_cost_info->estimatedTotalMem = totalMem(); query_cost_info->resourceUsage = resourceUsage(); query_cost_info->maxCpuUsage = maxCpuUsage();}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:21,
示例20: XML_Timer XML_Timer( U64 * sum ) : mSum( sum ) { mStart = totalTime(); }
开发者ID:DamianZhaoying,项目名称:SingularityViewer,代码行数:4,
示例21: mtvoid LLViewerObjectList::update(LLAgent &agent, LLWorld &world){ LLMemType mt(LLMemType::MTYPE_OBJECT); // Update globals gVelocityInterpolate = gSavedSettings.getBOOL("VelocityInterpolate"); gPingInterpolate = gSavedSettings.getBOOL("PingInterpolate"); gAnimateTextures = gSavedSettings.getBOOL("AnimateTextures"); // update global timer F32 last_time = gFrameTimeSeconds; U64 time = totalTime(); // this will become the new gFrameTime when the update is done // Time _can_ go backwards, for example if the user changes the system clock. // It doesn't cause any fatal problems (just some oddness with stats), so we shouldn't assert here.// llassert(time > gFrameTime); F64 time_diff = U64_to_F64(time - gFrameTime)/(F64)SEC_TO_MICROSEC; gFrameTime = time; F64 time_since_start = U64_to_F64(gFrameTime - gStartTime)/(F64)SEC_TO_MICROSEC; gFrameTimeSeconds = (F32)time_since_start; gFrameIntervalSeconds = gFrameTimeSeconds - last_time; if (gFrameIntervalSeconds < 0.f) { gFrameIntervalSeconds = 0.f; } //clear avatar LOD change counter LLVOAvatar::sNumLODChangesThisFrame = 0; const F64 frame_time = LLFrameTimer::getElapsedSeconds(); std::vector<LLViewerObject*> kill_list; S32 num_active_objects = 0; LLViewerObject *objectp = NULL; // Make a copy of the list in case something in idleUpdate() messes with it std::vector<LLViewerObject*> idle_list; idle_list.reserve( mActiveObjects.size() ); for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin(); active_iter != mActiveObjects.end(); active_iter++) { objectp = *active_iter; if (objectp) { idle_list.push_back( objectp ); } else { // There shouldn't be any NULL pointers in the list, but they have caused // crashes before. This may be idleUpdate() messing with the list. llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl; } } if (gSavedSettings.getBOOL("FreezeTime")) { for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin(); iter != idle_list.end(); iter++) { objectp = *iter; if (objectp->getPCode() == LLViewerObject::LL_VO_CLOUDS || objectp->isAvatar()) { objectp->idleUpdate(agent, world, frame_time); } } } else { for (std::vector<LLViewerObject*>::iterator idle_iter = idle_list.begin(); idle_iter != idle_list.end(); idle_iter++) { objectp = *idle_iter; if (!objectp->idleUpdate(agent, world, frame_time)) { // If Idle Update returns false, kill object! kill_list.push_back(objectp); } else { num_active_objects++; } } for (std::vector<LLViewerObject*>::iterator kill_iter = kill_list.begin(); kill_iter != kill_list.end(); kill_iter++) { objectp = *kill_iter; killObject(objectp); } } mNumSizeCulled = 0; mNumVisCulled = 0; // compute all sorts of time-based stats // don't factor frames that were paused into the stats if (! mWasPaused) { gViewerStats->updateFrameStats(time_diff); }//.........这里部分代码省略.........
开发者ID:Boy,项目名称:netbook,代码行数:101,
示例22: ~XML_Timer() { *mSum += (totalTime() - mStart); }
开发者ID:DamianZhaoying,项目名称:SingularityViewer,代码行数:4,
注:本文中的totalTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ touch函数代码示例 C++ total函数代码示例 |