Golang-个体操作的持续时间

I have an algorithm that performs a mathematical operation on a pixel within a PNG image, it then draws a new image from the result. I'm wanting to show the duration time for the entire process and then be more specific and show the time time taken for each individual pixel.

The result of the algorithm is shown in the terminal:

>> image pixels:  921600  -- width x height: 960 - 960
>> time elapsed (m-seconds) :  165.913052ms

My initial thinking was to output the result of elapsed / totalPixels however this results in an error due to incorrect types.

Try convert type

elapsed/time.Duration(totalPixels)

or

int(elapsed)/totalPixels