Is there a way to track the time between a mouseDown and a mouseUp event in swift? Or would one have to implement their own tracker manually?
Asked
Active
Viewed 155 times
1 Answers
0
You can just check the NSEvent.timestamp
, which is a TimeInterval
(typealias for Double
, storing number of seconds):
let duration = mouseUpEvent.timestamp - mouseDownEvent.timestamp

Alexander
- 59,041
- 12
- 98
- 151