> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XtfGetSystemUpTime

> XtfGetSystemUpTime

# XtfGetSystemUpTime

获取 System OS 和 Game OS 已运行的时间（毫秒）。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
HRESULT XtfGetSystemUpTime(
         PWCSTR address,
         UINT64* systemUpTimeSystem,
         UINT64* systemUpTimeTitle
)  
```

<a id="parametersSection" />

### 参数

*address*\
类型：PWCSTR

\[in] 主机的地址。

*systemUpTimeSystem*\
类型：UINT64\*

\[out, optional] System OS 已运行的时间，以毫秒为单位。如果不需要此值，请将其设置为 `nullptr`。

*systemUpTimeTitle*\
类型：UINT64\*

\[out, optional] Game OS 已运行的时间，以毫秒为单位。如果不需要此值，请将其设置为 `nullptr`。

<a id="retvalSection" />

### 返回值

类型：HRESULT

成功时返回 `S_OK`；否则返回一个 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此函数返回 System OS 和 Game OS 已运行的时间。
对于 System OS，此值是自主机启动以来的时间（毫秒）。对于 Game OS，此值是自游戏启动以来的时间（毫秒）。有关 System OS 和 Game OS 的更多信息，如需完整介绍，请参阅 [什么是 Microsoft Game Development Kit？(NDA 主题)](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/intro/introduction)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)\
[其他 Xtf API](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [IXtfConsoleControlClient::GetSystemTime](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getsystemtime.md)
- [XTFSYSTEMTIME](/zh-CN/reference/tools/xtf/xtfconsolecontrol/structs/xtfsystemtime.md)
- [IXtfConsoleControlClient](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)
- [XtfGetConsoleFieldValue](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m.md)
- [XtfDebugStringCallback](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfdebugstringcallback-xtfapi-xbox-windows-m.md)
