---
title: 函数：event_get_timestamp
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_1042.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_1042.html
indexId: fd73a88ad7f0fe3b2ec3076423da11c062b4c5d70c3f4ca0a3ed73a2521236dc71
---
# 函数：event_get_timestamp

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

获取Event的执行结束时间点（表示从AI处理器系统启动以来的时间）。

本接口需与其它关键接口配合使用，接口调用顺序：

- 调用  acl.rt.create_event
/  acl.rt.create_event_with_flag
接口创建Event。
- 调用  acl.rt.record_event
接口在Stream中记录Event。
- 调用  acl.rt.synchronize_stream
接口阻塞应用程序运行， 直到指定Stream中的所有任务都完成。
- 调用  acl.rt.event_get_timestamp
接口获取Event的执行时间。


#### 函数原型

- C函数原型
  1 aclError aclrtEventGetTimestamp(aclrtEvent event, uint64_t *timestamp)

- python函数
  1 timestamp, ret = acl.rt.event_get_timestamp(event)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| event | int，查询的Event。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| timestamp | int，Event执行结束的时间点，单位为微秒。 |
| ret | int，返回0表示成功，返回其他值表示失败，请参见17.1\-aclError。 |
