您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetSystemTimeAsFileTime函数代码示例

51自学网 2021-06-01 21:15:50
  C++
这篇教程C++ GetSystemTimeAsFileTime函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetSystemTimeAsFileTime函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSystemTimeAsFileTime函数的具体用法?C++ GetSystemTimeAsFileTime怎么用?C++ GetSystemTimeAsFileTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetSystemTimeAsFileTime函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetCurrentUTCTimeInUI64

inline uint64_t GetCurrentUTCTimeInUI64(){	FILETIME Timestamp;	GetSystemTimeAsFileTime(&Timestamp); // in UTC	return FileTimeToUI64(Timestamp);}
开发者ID:Firebie,项目名称:FarManager,代码行数:6,


示例2: NaClGetTimeOfDayIntern

int 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_times

voiddmnsn_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

/*********************************************************************** *		CertTrustFinalPolicy ([email
C++ GetTabControl函数代码示例
C++ GetSystemTime函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。