EASY SOLUTION || NO JOIN USED for low latency || MySQL || simple join can be used in it
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```mysql []
SELECT a.machine_id,round(avg(b.timestamp-a.timestamp),3) as processing_time
FROM Activity a,Activity b
WHERE a.machine_id=b.machine_id and a.activity_type='start' and b.activity_type='end'
GROUP BY a.machine_id
```
['MySQL']