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

#### 产品支持情况

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


#### 功能说明

msproftx用于记录事件发生的时间跨度的开始时间。

调用此接口后，Profiling自动在Stamp记录采集开始的时间戳，将Event type设置为Start/Stop，生成一个进程唯一的id，并将Stamp保存在以进程粒度维护的一个map中。


#### 函数原型

- C函数原型
  1 aclError aclprofRangeStart(void *stamp, uint32_t *rangeId)

- python函数
  1 range_id, ret = acl.prof.range_start(stamp)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| stamp | int，Stamp指针地址，指代msproftx事件标记。指定函数：create\_stamp接口的指针地址。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| range\_id | int，msproftx事件标记的唯一标识。用于在跨线程时区分。 |
| ret | int，错误码。 返回0表示成功。 返回其它值表示失败。 |


#### 约束说明

- 与  函数：range_stop
接口成对使用，表示时间跨度的开始和结束。
- 可以跨线程调用。
- 在  函数：create_stamp
接口和  函数：destroy_stamp
接口之间调用。
