-1

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?

1 Answers1

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