Function: event_elapsed_time

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Computes the elapsed time between two events.

Prototype

  • C Prototype
    1
    aclError aclrtEventElapsedTime(float *ms, aclrtEvent startEvent, aclrtEvent endEvent)
    
  • Python Function
    1
    ms, ret = acl.rt.event_elapsed_time(start, end)
    

Parameters

Parameter

Description

start

Int, pointer address of the start event object.

end

Int, pointer address of the end event object.

Return Values

Return Value

Description

ms

Float, elapsed time between two events, in milliseconds.

ret

Int, error code. 0 on success; else, failure.

Restrictions

API call sequence: Call acl.rt.create_event/acl.rt.create_event_with_flag to create an event. > Call acl.rt.record_event to record the start and end events in the same stream. > Call acl.rt.synchronize_stream to block the application until all tasks in the specified stream are complete. > Call acl.rt.event_elapsed_time to measure the elapsed time between two events.