cudaError_t cudaEventElapsedTime ( float *  ms,
cudaEvent_t  start,
cudaEvent_t  end 
)

Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). If either event has not been recorded yet, this function returns cudaErrorInvalidValue.

When stream is non-zero for either event (even if it uses the same stream ID), the result may be greater than expected. This is because the cudaEventRecord() operation takes place asynchronously and there is no guarantee that the measured latency is actually just between the two events. Any number of other different stream operations could execute in between the two measured events, thus altering the timing in a significant way.

Parameters:
ms - Time between start and stop in ms
start - Starting event
end - Stopping event
Returns:
cudaSuccess, cudaErrorInvalidValue, cudaErrorInitializationError, cudaErrorPriorLaunchFailure, cudaErrorInvalidResourceHandle
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also:
cudaEventCreate, cudaEventCreateWithFlags, cudaEventQuery, cudaEventSynchronize, cudaEventDestroy, cudaEventRecord


Generated by Doxygen for NVIDIA CUDA Library  NVIDIA