/base/hiviewdfx/hiview/base/utility/ |
D | time_util.cpp | 36 struct timeval now; in GenerateTimestamp() local 37 if (gettimeofday(&now, nullptr) == -1) { in GenerateTimestamp() 40 return (now.tv_sec * SEC_TO_MICROSEC + now.tv_usec); in GenerateTimestamp() 50 auto now = std::chrono::system_clock::now(); in GetMillSecOfSec() local 51 auto millisecs = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()); in GetMillSecOfSec() 57 auto now = std::chrono::system_clock::now(); in GetMilliseconds() local 58 auto millisecs = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()); in GetMilliseconds() 94 time_t now = std::time(nullptr); in Get0ClockStampMs() local 95 int64_t zero = now; in Get0ClockStampMs() 96 struct tm *l = std::localtime(&now); in Get0ClockStampMs() [all …]
|
/base/notification/distributed_notification_service/services/distributed/src/ |
D | distributed_flow_control.cpp | 31 std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); in KvManagerFlowControl() local 33 return now - value > std::chrono::minutes(1); in KvManagerFlowControl() 43 if (now - value > std::chrono::seconds(1)) { in KvManagerFlowControl() 53 kvDataManagerTimestampList_.push_front(now); in KvManagerFlowControl() 59 std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); in KvStoreFlowControl() local 61 return now - value > std::chrono::minutes(1); in KvStoreFlowControl() 71 if (now - value > std::chrono::seconds(1)) { in KvStoreFlowControl() 81 kvStoreTimestampList_.push_front(now); in KvStoreFlowControl()
|
/base/notification/eventhandler/test/systemtest/ems_inner_event_system_test/ |
D | ems_inner_event_system_test.cpp | 138 InnerEvent::TimePoint now = InnerEvent::Clock::now(); variable 139 event->SetHandleTime(now); 141 EXPECT_EQ(now, handleTime); 152 InnerEvent::TimePoint now = InnerEvent::TimePoint::max(); variable 153 event->SetHandleTime(now); 155 EXPECT_EQ(now, handleTime); 167 InnerEvent::TimePoint now = InnerEvent::Clock::time_point(); variable 168 event->SetHandleTime(now); 170 EXPECT_EQ(now, handleTime); 181 InnerEvent::TimePoint now = InnerEvent::TimePoint::min(); variable [all …]
|
/base/notification/distributed_notification_service/services/distributed/test/unittest/ |
D | distributed_flow_control_test.cpp | 51 std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); variable 52 distributedFlowControl.kvStoreTimestampList_.push_front(now); 69 std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); variable 70 distributedFlowControl.kvStoreTimestampList_.push_front(now);
|
/base/hiviewdfx/hiview/plugins/faultlogger/test/common/unittest/ |
D | faultlogger_client_unittest.cpp | 54 auto now = time(nullptr); variable 55 auto info = CreateFaultLogInfo(now, getuid(), FaultLogType::CPP_CRASH, "faultlogtest0"); 85 auto now = time(nullptr); variable 89 auto task = [](int32_t now) { in __anon5d66fa070102() argument 90 printf("AddFaultLog %d\n", now); in __anon5d66fa070102() 91 auto info = CreateFaultLogInfo(now, getuid(), FaultLogType::CPP_CRASH, "faultlogtest1"); in __anon5d66fa070102() 97 now = now + 1; 98 timeStamps.push_back(now); 99 task(now);
|
/base/global/resource_management_lite/frameworks/resmgr_lite/test/unittest/lite/common/ |
D | resource_manager_performance_test.cpp | 120 auto start = std::chrono::high_resolution_clock::now(); in TestLoadFromIndex() 142 auto end = std::chrono::high_resolution_clock::now(); in TestLoadFromIndex() 150 auto t1 = std::chrono::high_resolution_clock::now(); in TestLoadFromIndex() 179 auto t2 = std::chrono::high_resolution_clock::now(); in TestLoadFromIndex() 225 auto t1 = std::chrono::high_resolution_clock::now(); 227 auto t2 = std::chrono::high_resolution_clock::now(); 260 auto t1 = std::chrono::high_resolution_clock::now(); 262 auto t2 = std::chrono::high_resolution_clock::now(); 297 auto t1 = std::chrono::high_resolution_clock::now(); 299 auto t2 = std::chrono::high_resolution_clock::now(); [all …]
|
/base/global/resource_management/frameworks/resmgr/test/unittest/common/ |
D | resource_manager_performance_test.cpp | 117 auto t1 = std::chrono::high_resolution_clock::now(); in ParseIndexCost() 146 auto t2 = std::chrono::high_resolution_clock::now(); in ParseIndexCost() 164 auto start = std::chrono::high_resolution_clock::now(); in TestLoadFromIndex() 186 auto end = std::chrono::high_resolution_clock::now(); in TestLoadFromIndex() 237 auto t1 = std::chrono::high_resolution_clock::now(); 239 auto t2 = std::chrono::high_resolution_clock::now(); 272 auto t1 = std::chrono::high_resolution_clock::now(); 274 auto t2 = std::chrono::high_resolution_clock::now(); 309 auto t1 = std::chrono::high_resolution_clock::now(); 311 auto t2 = std::chrono::high_resolution_clock::now(); [all …]
|
/base/notification/common_event_service/services/src/ |
D | publish_manager.cpp | 36 int64_t now = SystemTime::GetNowSysTime(); in CheckIsFloodAttack() local 37 …NT_LOGD("dispatch common event by app (uid = %{publish}d) at now = %{public}" PRId64, appUid, now); in CheckIsFloodAttack() 40 floodAttackAppStatistics_[appUid].emplace_back(now); in CheckIsFloodAttack() 46 if (now - *iterVec > FLOOD_ATTACK_INTERVAL_MAX) { in CheckIsFloodAttack() 56 iter->second.emplace_back(now); in CheckIsFloodAttack()
|
/base/global/i18n/frameworks/zone/test/unittest/ |
D | zone_util_performance_test.cpp | 65 auto t1 = std::chrono::high_resolution_clock::now(); 67 auto t2 = std::chrono::high_resolution_clock::now(); 91 auto t1 = std::chrono::high_resolution_clock::now(); 93 auto t2 = std::chrono::high_resolution_clock::now(); 115 auto t1 = std::chrono::high_resolution_clock::now(); 117 auto t2 = std::chrono::high_resolution_clock::now(); 138 auto t1 = std::chrono::high_resolution_clock::now(); 140 auto t2 = std::chrono::high_resolution_clock::now(); 161 auto t1 = std::chrono::high_resolution_clock::now(); 163 auto t2 = std::chrono::high_resolution_clock::now(); [all …]
|
/base/telephony/ril_adapter/services/hril/src/ |
D | hril_event.cpp | 45 struct timeval now; in GetNextTimeOut() local 46 GetNowTime(now); in GetNextTimeOut() 47 TELEPHONY_LOGD("now = %{public}ds + %{public}dus", (int32_t)now.tv_sec, (int32_t)now.tv_usec); in GetNextTimeOut() 50 if (timercmp(&eventIt->timeout, &now, >)) { in GetNextTimeOut() 51 timersub(&eventIt->timeout, &now, &tv); in GetNextTimeOut() 61 struct timeval now; in ProcessTimerList() local 64 GetNowTime(now); in ProcessTimerList() 66 …OGD("finding for timers <= %{public}ds + %{public}dus", (int32_t)now.tv_sec, (int32_t)now.tv_usec); in ProcessTimerList() 67 while ((eventIt != timerList_.end()) && (timercmp(&now, &eventIt->timeout, >))) { in ProcessTimerList() 137 struct timeval now; in AddTimerEvent() local [all …]
|
/base/notification/eventhandler/frameworks/eventhandler/src/ |
D | event_handler.cpp | 66 InnerEvent::TimePoint now = InnerEvent::Clock::now(); in SendEvent() local 67 event->SetSendTime(now); in SendEvent() 71 event->SetHandleTime(now + std::chrono::milliseconds(delayTime)); in SendEvent() 73 event->SetHandleTime(now); in SendEvent() 90 InnerEvent::TimePoint nowSys = InnerEvent::Clock::now(); in SendTimingEvent() 283 InnerEvent::TimePoint nowEnd = InnerEvent::Clock::now(); in DistributeTimeAction() 309 auto now = InnerEvent::Clock::now(); in DistributeEvent() local 310 … auto currentRunningInfo = "start at " + InnerEvent::DumpTimeToString(now) + "; " + event->Dump(); in DistributeEvent() 322 InnerEvent::TimePoint nowStart = InnerEvent::Clock::now(); in DistributeEvent() 343 auto now = InnerEvent::Clock::now(); in DistributeEvent() local [all …]
|
/base/hiviewdfx/hiview/plugins/faultlogger/interfaces/cpp/innerkits/test/common/moduletest/ |
D | faultlogger_native_interface_test.cpp | 54 auto now = time(nullptr); variable 55 auto info = CreateFaultLogInfo(now, getuid(), FaultLogType::CPP_CRASH, "faultloggertest"); 58 ASSERT_TRUE(CheckLogFileExist(now, getuid(), "cppcrash", "faultloggertest")); 75 auto now = time(nullptr); variable 77 AddFaultLog(now, FaultLogType::CPP_CRASH, module, "faultloggertestsummary2"); 79 ASSERT_TRUE(CheckLogFileExist(now, getuid(), "cppcrash", module)); 96 auto now = time(nullptr); variable 101 AddFaultLog(now + i, FaultLogType::CPP_CRASH, module, "faultloggertestsummary2"); 107 ASSERT_TRUE(CheckLogFileExist(now + i, getuid(), "cppcrash", module)); 111 ASSERT_FALSE(CheckLogFileExist(now + i, getuid(), "cppcrash", module)); [all …]
|
/base/notification/distributed_notification_service/frameworks/ans/src/ |
D | reminder_request_timer.cpp | 31 time_t now; // unit is seconds. in ReminderRequestTimer() local 32 (void)time(&now); in ReminderRequestTimer() 34 …ReminderRequest::GetDurationSinceEpochInMilli(now) + countDownTimeInSeconds_ * ReminderRequest::MI… in ReminderRequestTimer() 98 time_t now; in UpdateTimeInfo() local 99 (void)time(&now); // unit is seconds. in UpdateTimeInfo() 100 whenToChangeSysTime_ = ReminderRequest::GetDurationSinceEpochInMilli(now); in UpdateTimeInfo()
|
/base/telephony/telephony_data/common/include/ |
D | time_util.h | 67 time_t now = time(DEFAULT_TIMER); in GetCurrentTime() local 68 if (now == -1) { in GetCurrentTime() 72 struct tm *ltm = localtime_r(&now, &tm); in GetCurrentTime() 83 time_t now = time(DEFAULT_TIMER) - THIRTY_DAYS; in GetTimeOfThirty() local 84 date = std::to_string(now); in GetTimeOfThirty()
|
/base/update/updateservice/services/firmware/common/src/ |
D | firmware_update_adapter.cpp | 51 time_t now; in GetRequestId() local 52 time(&now); in GetRequestId() 53 localtime_r(&now, &timeInfo); in GetRequestId() 61 srand((unsigned int)now); in GetRequestId()
|
/base/hiviewdfx/hiappevent/frameworks/native/libhiappevent/utility/ |
D | time_util.cpp | 29 auto now = std::chrono::system_clock::now(); in GetMilliseconds() local 30 auto millisecs = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()); in GetMilliseconds()
|
/base/hiviewdfx/faultloggerd/common/dfxutil/ |
D | elapsed_time.h | 27 begin_ = std::chrono::high_resolution_clock::now(); in ElapsedTime() 34 begin_ = std::chrono::high_resolution_clock::now(); in Reset() 40 …return std::chrono::duration_cast<Duration>(std::chrono::high_resolution_clock::now() - begin_).co… in Elapsed()
|
/base/hiviewdfx/hiview/base/test/unittest/common/ |
D | event_base_test.cpp | 27 auto now = std::chrono::system_clock::now(); in GetCurrentMillis() local 28 auto millisecs = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()); in GetCurrentMillis() 74 auto now = GetCurrentMillis(); variable 75 LoopEvent event1 = LoopEvent::CreateLoopEvent(now); 76 LoopEvent event2 = LoopEvent::CreateLoopEvent(now + 200); // 200ms later
|
/base/hiviewdfx/faultloggerd/test/unittest/common/ |
D | common_test.cpp | 49 time_t now = time(nullptr); variable 50 std::string timeStr = GetCurrentTimeStr(static_cast<uint64_t>(now)); 53 now += 100000; // 100000 : test time offset 54 timeStr = GetCurrentTimeStr(static_cast<uint64_t>(now));
|
/base/hiviewdfx/hiview/base/ |
D | event_loop.cpp | 166 uint64_t now = NanoSecondSinceSystemStart(); in AddEvent() local 173 LoopEvent loopEvent = LoopEvent::CreateLoopEvent(now); in AddEvent() 180 return now; in AddEvent() 202 uint64_t now = NanoSecondSinceSystemStart(); in AddEventForResult() local 203 LoopEvent loopEvent = LoopEvent::CreateLoopEvent(now); in AddEventForResult() 221 uint64_t now = NanoSecondSinceSystemStart(); in AddTimerEvent() local 223 if (now + intervalMicro < now) { in AddTimerEvent() 234 LoopEvent loopEvent = LoopEvent::CreateLoopEvent(now); in AddTimerEvent() 238 loopEvent.targetTime = now + intervalMicro; in AddTimerEvent() 245 return now; in AddTimerEvent() [all …]
|
/base/useriam/user_auth_framework/common/utils/ |
D | iam_time.cpp | 35 const time_point<system_clock> now = system_clock::now(); in GetNowTimeString() local 36 time_t tt = system_clock::to_time_t(now); in GetNowTimeString()
|
/base/hiviewdfx/faultloggerd/tools/crash_validator/ |
D | main.cpp | 31 auto now = time(nullptr); in SigIntHandler() local 32 if (now - lastHandleTime < breakTime) { in SigIntHandler() 39 lastHandleTime = now; in SigIntHandler()
|
/base/telephony/sms_mms/utils/ |
D | sms_hisysevent.cpp | 64 …std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_… in SetSmsBroadcastStartTime() 71 …std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_… in JudgingSmsBroadcastTimeOut() 82 …std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_… in SetCbBroadcastStartTime() 89 …std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_… in JudgingCbBroadcastTimeOut() 100 …std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_… in SetWapPushBroadcastStartTime() 107 …std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_… in JudgingWapPushBroadcastTimeOut()
|
/base/notification/eventhandler/frameworks/eventhandler/test/unittest/ |
D | lib_event_handler_event_queue_test.cpp | 128 auto now = InnerEvent::Clock::now(); in DelayTest() local 130 auto handleTime = now + std::chrono::milliseconds(static_cast<int64_t>(delayTime)); in DelayTest() 131 event->SetSendTime(now); in DelayTest() 136 now = InnerEvent::Clock::now(); in DelayTest() 137 EXPECT_GE(now, handleTime); in DelayTest() 140 EXPECT_LE(now, errorTime); in DelayTest() 157 auto now = InnerEvent::Clock::now(); in InsertPriorityTest() local 166 event->SetSendTime(now); in InsertPriorityTest() 167 event->SetHandleTime(now); in InsertPriorityTest() 243 auto now = InnerEvent::Clock::now(); in InsertPriorityEvent() local [all …]
|
/base/usb/usb_manager/test/native/js_unittest/ |
D | DateAndTimeUtil.js | 29 now() { method in DateAndTimeUtil 46 var now = this.concatTimeWithSeconds(hours, minutes, seconds); 47 console.info('now concat: ' + now); 48 return now;
|