Lines Matching defs:tv
470 struct timeval tv {};
471 tv.tv_sec = (time_t)(time / MILLI_TO_BASE);
472 tv.tv_usec = (suseconds_t)((time % MILLI_TO_BASE) * MILLI_TO_MICR);
473 int result = settimeofday(&tv, nullptr);
479 auto ret = SetRtcTime(tv.tv_sec);
741 struct timespec tv {};
742 if (GetTimeByClockId(CLOCK_REALTIME, tv)) {
743 time = tv.tv_sec * MILLI_TO_BASE + tv.tv_nsec / NANO_TO_MILLI;
751 struct timespec tv {};
752 if (GetTimeByClockId(CLOCK_BOOTTIME, tv)) {
753 time = tv.tv_sec * MILLI_TO_BASE + tv.tv_nsec / NANO_TO_MILLI;
761 struct timespec tv {};
762 if (GetTimeByClockId(CLOCK_BOOTTIME, tv)) {
763 time = tv.tv_sec * NANO_TO_BASE + tv.tv_nsec;
771 struct timespec tv {};
777 if (GetTimeByClockId(cid, tv)) {
778 time = tv.tv_sec * MILLI_TO_BASE + tv.tv_nsec / NANO_TO_MILLI;
786 struct timespec tv {};
792 if (GetTimeByClockId(cid, tv)) {
793 time = tv.tv_sec * NANO_TO_BASE + tv.tv_nsec;
799 bool TimeSystemAbility::GetTimeByClockId(clockid_t clockId, struct timespec &tv)
801 if (clock_gettime(clockId, &tv) < 0) {