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

# XtfGetSystemUpTime

> XtfGetSystemUpTime

# XtfGetSystemUpTime

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

## 语法

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

### 参数

*address*\
类型：PWCSTR

\[in] 主机的地址。

*systemUpTimeSystem*\
类型：UINT64\*

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

*systemUpTimeTitle*\
类型：UINT64\*

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

### 返回值

类型：HRESULT

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

## 备注

此函数返回 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)。

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

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

## 另请参阅

[XTF 传输错误 (NDA 主题)](https://docs.xbox.com/zh-CN/tools/tools-console/commandlinetools/xtf-transport-errors.md)\
[其他 Xtf API](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/atoc-xtfapi.md)


## Related topics

- [其他 Xtf API（API 内容）](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfapi/atoc-xtfapi.md)
- [GetSystemTime](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getsystemtime.md)
- [Get Time](https://docs.xbox.com/api-reference/title-wide-data-management/get-time.md)
- [XTFSYSTEMTIME](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/structs/xtfsystemtime.md)
- [IXtfConsoleControlClient（接口内容）](https://docs.xbox.com/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)
