> ## 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 已執行的時間量 (以毫秒為單位)。

## 語法

```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 主題)](/zh-TW/tools/tools-console/commandlinetools/xtf-transport-errors)\
[其他 Xtf API](/zh-TW/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [GetSystemTime](/zh-TW/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getsystemtime.md)
- [Get Time](/api-reference/title-wide-data-management/get-time.md)
- [XTFSYSTEMTIME](/zh-TW/reference/tools/xtf/xtfconsolecontrol/structs/xtfsystemtime.md)
- [IXtfConsoleControlClient (介面內容)](/zh-TW/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)
- [XtfGetConsoleFieldValue](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m.md)
