这篇教程C++ GetSystemTimeAsFileTime函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetSystemTimeAsFileTime函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSystemTimeAsFileTime函数的具体用法?C++ GetSystemTimeAsFileTime怎么用?C++ GetSystemTimeAsFileTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetSystemTimeAsFileTime函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetCurrentUTCTimeInUI64inline uint64_t GetCurrentUTCTimeInUI64(){ FILETIME Timestamp; GetSystemTimeAsFileTime(&Timestamp); // in UTC return FileTimeToUI64(Timestamp);}
开发者ID:Firebie,项目名称:FarManager,代码行数:6,
示例2: NaClGetTimeOfDayInternint NaClGetTimeOfDayIntern(struct nacl_abi_timeval *tv, struct NaClTimeState *ntsp) { FILETIME ft_now; DWORD ms_counter_now; uint64_t t_ms; DWORD ms_counter_at_ft_now; uint32_t ms_counter_diff; uint64_t unix_time_ms; GetSystemTimeAsFileTime(&ft_now); ms_counter_now = timeGetTime(); t_ms = NaClFileTimeToMs(&ft_now); NaClMutexLock(&ntsp->mu); NaClLog(5, "ms_counter_now %"NACL_PRIu32"/n", (uint32_t) ms_counter_now); NaClLog(5, "t_ms %"NACL_PRId64"/n", t_ms); NaClLog(5, "system_time_start_ms %"NACL_PRIu64"/n", ntsp->system_time_start_ms); ms_counter_at_ft_now = (DWORD) (ntsp->ms_counter_start + (uint32_t) (t_ms - ntsp->system_time_start_ms)); NaClLog(5, "ms_counter_at_ft_now %"NACL_PRIu32"/n", (uint32_t) ms_counter_at_ft_now); ms_counter_diff = ms_counter_now - (uint32_t) ms_counter_at_ft_now; NaClLog(5, "ms_counter_diff %"NACL_PRIu32"/n", ms_counter_diff); if (ms_counter_diff <= kMaxMillsecondDriftBeforeRecalibration) { t_ms = t_ms + ms_counter_diff; } else { NaClCalibrateWindowsClockMu(ntsp); t_ms = ntsp->system_time_start_ms; } NaClLog(5, "adjusted t_ms = %"NACL_PRIu64"/n", t_ms); unix_time_ms = t_ms - ntsp->epoch_start_ms; /* * Time is monotonically non-decreasing. */ if (unix_time_ms < ntsp->last_reported_time_ms) { unix_time_ms = ntsp->last_reported_time_ms; } else { ntsp->last_reported_time_ms = unix_time_ms; } NaClMutexUnlock(&ntsp->mu); NaClLog(5, "unix_time_ms = %"NACL_PRId64"/n", unix_time_ms); /* * Unix time is measured relative to a different epoch, Jan 1, 1970. * See the module initialization for epoch_start_ms. */ tv->nacl_abi_tv_sec = (nacl_abi_time_t) (unix_time_ms / 1000); tv->nacl_abi_tv_usec = (nacl_abi_suseconds_t) ((unix_time_ms % 1000) * 1000); NaClLog(5, "nacl_avi_tv_sec = %"NACL_PRIdNACL_TIME"/n", tv->nacl_abi_tv_sec); NaClLog(5, "nacl_avi_tv_usec = %"NACL_PRId32"/n", tv->nacl_abi_tv_usec); return 0;}
开发者ID:eseidel,项目名称:native_client_patches,代码行数:69,
示例3: dmnsn_get_timesvoiddmnsn_get_times(dmnsn_timer *timer){#if DMNSN_GETRUSAGE struct timeval real; gettimeofday(&real, NULL); struct rusage usage; if (getrusage(RUSAGE_SELF, &usage) == 0) { timer->real = dmnsn_timeval2double(real); timer->user = dmnsn_timeval2double(usage.ru_utime); timer->system = dmnsn_timeval2double(usage.ru_stime); } else { dmnsn_warning("getrusage() failed."); timer->real = timer->user = timer->system = 0.0; }#elif DMNSN_TIMES static long clk_tck = 0; // Figure out the clock ticks per second if (!clk_tck) { clk_tck = sysconf(_SC_CLK_TCK); if (clk_tck == -1) { dmnsn_warning("sysconf(_SC_CLK_TCK) failed."); clk_tck = 1000000L; } } struct tms buf; clock_t real = times(&buf); if (real == (clock_t)-1) { dmnsn_warning("times() failed."); timer->real = timer->user = timer->system = 0.0; } else { timer->real = (double)real/clk_tck; timer->user = (double)buf.tms_utime/clk_tck; timer->system = (double)buf.tms_stime/clk_tck; }#elif defined(_WIN32) FILETIME real; GetSystemTimeAsFileTime(&real); FILETIME user, system, creation, exit; HANDLE current_process = GetCurrentProcess(); if (GetProcessTimes(current_process, &creation, &exit, &system, &user) != 0) { timer->real = (((uint64_t)real.dwHighDateTime << 32) + real.dwLowDateTime)/1.0e7; timer->user = (((uint64_t)user.dwHighDateTime << 32) + user.dwLowDateTime)/1.0e7; timer->system = (((uint64_t)system.dwHighDateTime << 32) + system.dwLowDateTime)/1.0e7; } else { dmnsn_warning("GetProcessTimes() failed."); timer->real = timer->user = timer->system = 0.0; }#else timer->real = timer->user = timer->system = 0.0;#endif}
开发者ID:tavianator,项目名称:dimension,代码行数:61,
示例4: ReadWakaTimeConfigFile#include "CommonUtility.h"#include "INIReader.h"#include <Knownfolders.h>#include <Shlobj.h>#include <Pathcch.h>#include <sstream>// Mandatory initialization of static class variable outside the header file.static FILETIME local;FILETIME EditRecordTimer::lastUpdatedTimeStamp = (GetSystemTimeAsFileTime(&local), local);ManageWakaTimeConfigFile gConfigFileManager;static const std::wstring pythoncmd = L"python.exe";static const std::wstring WAKATIME_CONFIG_NAME(L".wakatime.cfg");#include <Shlwapi.h>bool ManageWakaTimeConfigFile::ReadWakaTimeConfigFile(){ // Read the wakatime.cfg file under users home directory if it exists. WCHAR* path; bool status = false; if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Profile, SHGFP_TYPE_CURRENT, 0, &path))) { WCHAR fullPath[MAX_PATH];#pragma warning(disable : 4995) if (SUCCEEDED(PathCombine(fullPath, path, WAKATIME_CONFIG_NAME.c_str()))) { m_FileName = fullPath; status = true; } CoTaskMemFree(path);
开发者ID:pritianka,项目名称:photoshopwindows,代码行数:31,
示例5: CertTrustFinalPolicy |