这篇教程C++ systemTime函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中systemTime函数的典型用法代码示例。如果您正苦于以下问题:C++ systemTime函数的具体用法?C++ systemTime怎么用?C++ systemTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了systemTime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: systemTimestatus_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime){ WinCondition* condState = (WinCondition*) mState; HANDLE hMutex = (HANDLE) mutex.mState; nsecs_t absTime = systemTime()+reltime; return ((WinCondition*)mState)->wait(condState, hMutex, &absTime);}
开发者ID:Andproject,项目名称:platform_frameworks_base,代码行数:8,
示例2: waitForLiberationLocked static void waitForLiberationLocked() { if (sThread == NULL) { return; } const nsecs_t timeout = 500 * 1000 * 1000; nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); nsecs_t timeToStop = now + timeout; while (!sThread->mQueue.isEmpty() && now < timeToStop) { sThread->mFreedCondition.waitRelative(sMutex, timeToStop - now); now = systemTime(SYSTEM_TIME_MONOTONIC); } if (!sThread->mQueue.isEmpty()) { ALOGW("waitForLiberationLocked timed out"); } }
开发者ID:4Fwolf,项目名称:mt6572_x201,代码行数:17,
示例3: camera_take_snapshot_stepvoid camera_take_snapshot_step(enum CAMERA_TAKEPIC_STEP step){ if (step > CMR_STEP_CALL_BACK) { CMR_LOGE("error %d", step); return; } cap_stp[step].timestamp = systemTime(CLOCK_MONOTONIC); cap_stp[step].valid = 1;}
开发者ID:sky8336,项目名称:mn201307,代码行数:9,
示例4: DBGT_PROLOGvoid SystemTimePerfTimer::init() { DBGT_PROLOG(""); //store current time mInitTime = systemTime(SYSTEM_TIME_REALTIME); DBGT_EPILOG(""); }
开发者ID:Meticulus,项目名称:vendor_st-ericsson_u8500,代码行数:9,
示例5: LOGVstatus_t AudioPolicyManager::stopOutput(audio_io_handle_t output, AudioSystem::stream_type stream, int session){ LOGV("stopOutput() output %d, stream %d", output, stream); ssize_t index = mOutputs.indexOfKey(output); if (index < 0) { LOGW("stopOutput() unknow output %d", output); return BAD_VALUE; } AudioOutputDescriptor *outputDesc = mOutputs.valueAt(index); routing_strategy strategy = AudioPolicyManagerBase::getStrategy((AudioSystem::stream_type)stream); // handle special case for sonification while in call if (isInCall()) { AudioPolicyManagerBase::handleIncallSonification(stream, false, false); } if (outputDesc->mRefCount[stream] > 0) { // decrement usage count of this stream on the output outputDesc->changeRefCount(stream, -1); // store time at which the last music track was stopped - see computeVolume() if (stream == AudioSystem::MUSIC) { outputDesc->mStopTime[stream] = systemTime(); // mMusicStopTime = systemTime(); }#ifdef WITH_QCOM_LPA uint32_t newDevice = AudioPolicyManagerBase::getNewDevice(mHardwareOutput, false); if(newDevice == 0 && mLPADecodeOutput != -1) { newDevice = AudioPolicyManagerBase::getNewDevice(mLPADecodeOutput, false); } setOutputDevice(output, newDevice);#else setOutputDevice(output, AudioPolicyManagerBase::getNewDevice(output));#endif#ifdef WITH_A2DP if (mA2dpOutput != 0 && !a2dpUsedForSonification() && (strategy == STRATEGY_SONIFICATION || strategy == STRATEGY_ENFORCED_AUDIBLE)) { setStrategyMute(STRATEGY_MEDIA, false, mA2dpOutput, mOutputs.valueFor(mHardwareOutput)->mLatency*2); }#endif if (output != mHardwareOutput) { setOutputDevice(mHardwareOutput, AudioPolicyManagerBase::getNewDevice(mHardwareOutput), true); } return NO_ERROR; } else { LOGW("stopOutput() refcount is already 0 for output %d", output); return INVALID_OPERATION; }}
开发者ID:chambejp,项目名称:hardware,代码行数:56,
示例6: sizeofvoid GraphicLog::logImpl(int32_t tag, int32_t buffer){ uint8_t scratch[2 + 2 + sizeof(int32_t) + sizeof(int64_t)]; size_t pos = 0; scratch[pos++] = EVENT_TYPE_LIST; scratch[pos++] = 2; writeInt32(scratch, pos, buffer); writeInt64(scratch, pos, ns2ms( systemTime( SYSTEM_TIME_MONOTONIC ) )); android_bWriteLog(tag, scratch, sizeof(scratch));}
开发者ID:AlexStephen,项目名称:android_device_samsung_totoro,代码行数:10,
示例7: newStats/** * override for IAtomIspObserver::atomIspNotify() * * signal start of 3A processing based on 3A statistics available event * store SOF event information for future use */bool AAAThread::atomIspNotify(IAtomIspObserver::Message *msg, const ObserverState state){ if(msg && msg->id == IAtomIspObserver::MESSAGE_ID_EVENT) { if (mSensorEmbeddedMetaDataEnabled || msg->data.event.type == EVENT_TYPE_METADATA_READY) { mSensorEmbeddedMetaDataEnabled = true; // When both sensor metadata event and statistics event are ready, then triggers 3A run if (msg->data.event.type == EVENT_TYPE_METADATA_READY) { mTrigger3A |= EVENT_TYPE_METADATA_READY; if (mTrigger3A & EVENT_TYPE_STATISTICS_READY) { mTrigger3A = 0; newStats(mCachedStatsEventMsg.data.event.timestamp, mCachedStatsEventMsg.data.event.sequence); CLEAR(mCachedStatsEventMsg); } return NO_ERROR; } if (msg->data.event.type == EVENT_TYPE_STATISTICS_READY) { mTrigger3A |= EVENT_TYPE_STATISTICS_READY; if (mTrigger3A & EVENT_TYPE_METADATA_READY) { mTrigger3A = 0; newStats(msg->data.event.timestamp, msg->data.event.sequence); } else { mCachedStatsEventMsg = *msg; } return NO_ERROR; } } else if (msg->data.event.type == EVENT_TYPE_STATISTICS_READY) { LOG2("-- STATS READY, seq %d, ts %lldus, systemTime %lldms ---", msg->data.event.sequence, nsecs_t(msg->data.event.timestamp.tv_sec)*1000000LL + nsecs_t(msg->data.event.timestamp.tv_usec), systemTime()/1000/1000); newStats(msg->data.event.timestamp, msg->data.event.sequence); } } else if (msg && msg->id == IAtomIspObserver::MESSAGE_ID_FRAME) { LOG2("--- FRAME, seq %d, ts %lldms, systemTime %lldms ---", msg->data.frameBuffer.buff.frameSequenceNbr, nsecs_t(msg->data.frameBuffer.buff.capture_timestamp.tv_sec)*1000000LL + nsecs_t(msg->data.frameBuffer.buff.capture_timestamp.tv_usec), systemTime()/1000/1000); newFrame(&msg->data.frameBuffer.buff); } return false;}
开发者ID:bju2000,项目名称:android_hardware_intel,代码行数:49,
示例8: ATRACE_CALLint Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) { ATRACE_CALL(); ALOGV("Surface::queueBuffer"); Mutex::Autolock lock(mMutex); int64_t timestamp; bool isAutoTimestamp = false; if (mTimestamp == NATIVE_WINDOW_TIMESTAMP_AUTO) { timestamp = systemTime(SYSTEM_TIME_MONOTONIC); isAutoTimestamp = true; ALOGV("Surface::queueBuffer making up timestamp: %.2f ms", timestamp / 1000000.f); } else { timestamp = mTimestamp; } int i = getSlotFromBufferLocked(buffer); if (i < 0) { return i; } // Make sure the crop rectangle is entirely inside the buffer. Rect crop; mCrop.intersect(Rect(buffer->width, buffer->height), &crop);#ifdef QCOM_BSP Rect dirtyRect = mDirtyRect; if(dirtyRect.isEmpty()) { int drWidth = mUserWidth ? mUserWidth : mDefaultWidth; int drHeight = mUserHeight ? mUserHeight : mDefaultHeight; dirtyRect = Rect(drWidth, drHeight); }#endif sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : Fence::NO_FENCE); IGraphicBufferProducer::QueueBufferOutput output; IGraphicBufferProducer::QueueBufferInput input(timestamp, isAutoTimestamp, crop,#ifdef QCOM_BSP dirtyRect,#endif mScalingMode, mTransform, mSwapIntervalZero,fence); status_t err = mGraphicBufferProducer->queueBuffer(i, input, &output); if (err != OK) { ALOGE("queueBuffer: error queuing buffer to SurfaceTexture, %d", err); } uint32_t numPendingBuffers = 0; output.deflate(&mDefaultWidth, &mDefaultHeight, &mTransformHint, &numPendingBuffers); mConsumerRunningBehind = (numPendingBuffers >= 2);#ifdef QCOM_BSP mDirtyRect.clear();#endif return err;}
开发者ID:Angels-group,项目名称:cm11-p6-1,代码行数:55,
示例9: getSelfint FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer){ FramebufferNativeWindow* self = getSelf(window); framebuffer_device_t* fb = self->fbDev; int index = self->mBufferHead;#ifdef GFX_TESTFRAMEWORK char eventID[TF_EVENT_ID_SIZE_MAX]; snprintf(eventID, TF_EVENT_ID_SIZE_MAX, "Dequeue-%d", index); nsecs_t start = systemTime(); TF_PRINT(TF_EVENT_START, "FBNW", eventID, "BUFFER:FBNW dequeue start");#endif GraphicLog& logger(GraphicLog::getInstance()); logger.log(GraphicLog::SF_FB_DEQUEUE_BEFORE, index); /* The buffer is available, return it */ Mutex::Autolock _l(self->mutex); // wait if the number of free buffers <= 0 while (self->mNumFreeBuffers <= 0) { self->mCondition.wait(self->mutex); } self->mBufferHead++; if (self->mBufferHead >= self->mNumBuffers) self->mBufferHead = 0; // get this buffer self->mNumFreeBuffers--; self->mCurrentBufferIndex = index; *buffer = self->buffers[index].get();#ifdef GFX_TESTFRAMEWORK nsecs_t end = systemTime(); int dqtime = ns2ms(end - start); TF_PRINT(TF_EVENT_STOP, "FBNW", eventID, "BUFFER:FBNW dequeue end, DequeueTime %d on buf %d", dqtime, index);#endif logger.log(GraphicLog::SF_FB_DEQUEUE_AFTER, index); return 0;}
开发者ID:Dmoriarty,项目名称:frameworks_base,代码行数:42,
示例10: systemTimevoid Layer::onPostComposition() { if (mFrameLatencyNeeded) { const HWComposer& hwc = mFlinger->getHwComposer(); const size_t offset = mFrameLatencyOffset; mFrameStats[offset].timestamp = mSurfaceTexture->getTimestamp(); mFrameStats[offset].set = systemTime(); mFrameStats[offset].vsync = hwc.getRefreshTimestamp(HWC_DISPLAY_PRIMARY); mFrameLatencyOffset = (mFrameLatencyOffset + 1) % 128; mFrameLatencyNeeded = false; }}
开发者ID:Benzonat0r,项目名称:omx-components-u8500,代码行数:11,
示例11: systemTimebool AudioPolicyManagerBase::isStreamActive(int stream, uint32_t inPastMs) const{ nsecs_t sysTime = systemTime(); for (size_t i = 0; i < mOutputs.size(); i++) { if (mOutputs.valueAt(i)->mRefCount[stream] != 0 || ns2ms(sysTime - mOutputs.valueAt(i)->mStopTime[stream]) < inPastMs) { return true; } } return false;}
开发者ID:791254467,项目名称:android_device_motorola_omap34com,代码行数:11,
示例12: mDestroyedDisplayList::DisplayList(const DisplayListRenderer& recorder) : mDestroyed(false), mTransformMatrix(NULL), mTransformCamera(NULL), mTransformMatrix3D(NULL), mStaticMatrix(NULL), mAnimationMatrix(NULL) { initFromDisplayListRenderer(recorder);#if MTK_DEBUG_ERROR_CHECK mTid = gettid(); mTimestamp = systemTime(SYSTEM_TIME_MONOTONIC); Caches::getInstance().addDisplayList(this);#endif}
开发者ID:LuckJC,项目名称:pro-fw,代码行数:12,
示例13: setBrightnessValueBg_notifyRenderTimevoid setBrightnessValueBg_notifyRenderTime(float time){ static void *handle; void *func; int boost_level = LEVEL_BOOST_NOP, first_frame = 0; static nsecs_t mPreviousTime = 0; char buff[64]; nsecs_t now = systemTime(CLOCK_MONOTONIC); //init(); setBrightnessValueBg_notifyFrameUpdate(1); //ALOGI("setBrightnessValueBg_notifyRenderTime: time:%f", time);#if 0 if(handle == NULL) { handle = dlopen("libperfservice.so", RTLD_NOW); func = dlsym(handle, "perfCalcBoostLevel"); perfCalcBoostLevel = reinterpret_cast<calc_boost_level>(func); if (perfCalcBoostLevel == NULL) { ALOGE("perfCalcBoostLevel init fail!"); } } if(mPreviousTime == 0 || (now - mPreviousTime) > RENDER_THREAD_CHECK_DURATION) { // exceed RENDER_THREAD_CHECK_DURATION => first frame first_frame = 1; } mPreviousTime = now; if(first_frame) { //ALOGI("setBrightnessValueBg_notifyRenderTime: first_frame"); if(perfCalcBoostLevel) perfCalcBoostLevel(0); return; } if(perfCalcBoostLevel) { boost_level = perfCalcBoostLevel(time); } // init value //sprintf(buff, "notifyRenderTime:%.2f", time); if(boost_level == LEVEL_BOOST_NOP) return; sprintf(buff, "levelBoost:%d", boost_level); ATRACE_BEGIN(buff);#if defined(MTK_LEVEL_BOOST_SUPPORT) setBrightnessValueBg_levelBoost(boost_level);#endif ATRACE_END();#endif}
开发者ID:yucz,项目名称:AndroidCpuTools,代码行数:53,
示例14: _lvoid SFWatchDog::markStartTransactionTime(uint32_t index) { Mutex::Autolock _l(mLock); if (index >= mNodeList.size()) { XLOGE("[unmarkStartTransactionTime] index=%d > Node list size=%d", index, mNodeList.size()); return; } mNodeList[index]->mStartTransactionTime = systemTime(); mUpdateCount ++; if (mShowLog) XLOGV("[%s] name=%s, index=%d, time = %" PRId64 "", __func__, mNodeList[index]->mName.string(), index, mNodeList[index]->mStartTransactionTime);}
开发者ID:aurorarom,项目名称:JsonUtil,代码行数:13,
示例15: acquire_wake_lockvoid TrimTask::run() { acquire_wake_lock(PARTIAL_WAKE_LOCK, kWakeLock); for (const auto& path : mPaths) { LOG(DEBUG) << "Starting trim of " << path; int fd = open(path.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW); if (fd < 0) { PLOG(WARNING) << "Failed to open " << path; continue; } struct fstrim_range range; memset(&range, 0, sizeof(range)); range.len = ULLONG_MAX; nsecs_t start = systemTime(SYSTEM_TIME_BOOTTIME); if (ioctl(fd, (mFlags & Flags::kDeepTrim) ? FIDTRIM : FITRIM, &range)) { PLOG(WARNING) << "Trim failed on " << path; notifyResult(path, -1, -1); } else { nsecs_t delta = systemTime(SYSTEM_TIME_BOOTTIME) - start; LOG(INFO) << "Trimmed " << range.len << " bytes on " << path << " in " << nanoseconds_to_milliseconds(delta) << "ms"; notifyResult(path, range.len, delta); } close(fd); if (mFlags & Flags::kBenchmarkAfter) {#if BENCHMARK_ENABLED BenchmarkPrivate(path);#else LOG(DEBUG) << "Benchmark disabled";#endif } } release_wake_lock(kWakeLock);}
开发者ID:rockchip-toybrick,项目名称:system-vold,代码行数:39,
示例16: MessageMessage* Message::createMessage(MessageHandlerInterface* target){ Message* msg = new Message(); if(NULL == msg){ return NULL; } msg->flags = FLAG_FREE; msg->mTarget = target; int i = 5; msg->mData = reinterpret_cast<int*>(&i); msg->when = systemTime(SYSTEM_TIME_MONOTONIC); msg->type = TYPE_HAVE_CALLBACK; return msg;}
开发者ID:chenglanjudy,项目名称:android_native_threadmanager,代码行数:13,
示例17: _lbool Caches::dumpActiveDisplayLists(DisplayList *displayList) { Mutex::Autolock _l(mDisplayListLock); ALOGW("Active DisplayLists: %d (%lld)", activeDisplayLists.size(), systemTime(SYSTEM_TIME_MONOTONIC)); bool isFound = false; DisplayList *item; for (size_t i = 0; i < activeDisplayLists.size(); i++) { item = activeDisplayLists.itemAt(i); ALOGW("/t[%d] %p, tid=%d, time=%lld", i, item, item->mTid, item->mTimestamp); if (item == displayList) isFound = true; } return isFound;}
开发者ID:4Fwolf,项目名称:mt6572_x201,代码行数:13,
示例18: _lstatus_t MessageQueue::queueMessage( const sp<MessageBase>& message, nsecs_t relTime, uint32_t flags){ Mutex::Autolock _l(mLock); message->when = systemTime() + relTime; mMessages.insert(message); //LOGD("MessageQueue::queueMessage time = %lld ms", message->when); //dumpLocked(message); mCondition.signal(); return NO_ERROR;}
开发者ID:Frontier314,项目名称:android_hardware_samsung_slsi,代码行数:13,
示例19: VDS_LOGW_IFvoid VirtualDisplaySurface::onFrameCommitted() { if (mDisplayId < 0) return; VDS_LOGW_IF(mDbgState != DBG_STATE_HWC, "Unexpected onFrameCommitted() in %s state", dbgStateStr()); mDbgState = DBG_STATE_IDLE; sp<Fence> fbFence = mHwc.getAndResetReleaseFence(mDisplayId); if (mFbProducerSlot >= 0) { // release the scratch buffer back to the pool Mutex::Autolock lock(mMutex); int sslot = mapProducer2SourceSlot(SOURCE_SCRATCH, mFbProducerSlot); VDS_LOGV("onFrameCommitted: release scratch sslot=%d", sslot); addReleaseFenceLocked(sslot, mProducerBuffers[mFbProducerSlot], fbFence); releaseBufferLocked(sslot, mProducerBuffers[mFbProducerSlot], EGL_NO_DISPLAY, EGL_NO_SYNC_KHR); } if (mOutputProducerSlot >= 0) { int sslot = mapProducer2SourceSlot(SOURCE_SINK, mOutputProducerSlot); QueueBufferOutput qbo; sp<Fence> outFence = mHwc.getLastRetireFence(mDisplayId); VDS_LOGV("onFrameCommitted: queue sink sslot=%d", sslot); // Allow queuing to sink buffer if mMustRecompose is true or // mForceHwcCopy is true. This is required to support Miracast WFD Sink // Initiatied Pause/Resume feature support if (mForceHwcCopy || mMustRecompose) { status_t result = mSource[SOURCE_SINK]->queueBuffer(sslot, QueueBufferInput( systemTime(), false /* isAutoTimestamp */, Rect(mSinkBufferWidth, mSinkBufferHeight), NATIVE_WINDOW_SCALING_MODE_FREEZE, 0 /* transform */, true /* async*/, outFence), &qbo); if (result == NO_ERROR) { updateQueueBufferOutput(qbo); } } else { // If the surface hadn't actually been updated, then we only went // through the motions of updating the display to keep our state // machine happy. We cancel the buffer to avoid triggering another // re-composition and causing an infinite loop. mSource[SOURCE_SINK]->cancelBuffer(sslot, outFence); } } resetPerFrameState();}
开发者ID:Cheshkin,项目名称:android_frameworks_native_mtk,代码行数:50,
|