Holding jump button

Hello, I am making a platform game and I want to control the jump height by holding the jump button.
I mean, I want this:

If I hold the jump button for 2 secs → the character makes a full jump
If I hold the jump button for less than a sec → the character makes a little hop

How do I do that?

While the jump button is pressed, start a timer.
When the jump button is released, stop the timer.
If the time on the timer is >=2s, do a big jump, otherwise, do a small jump.

First of all, thanks for your answer!
Now, how do I make a big and a small jump?
I gave to my character a platform behaviour and all the jumps are the same height, I dont know how to change that by events.
Even if I knew how to make a big and a small jump, the “release button” event trigers when the character already jumped, and the height can´t be changed at that point. If I change the height by releasing, the first jump is normal and the height gets decresed for a future jump that will be smaller even if I hold the button.
I need an event that interrupts the jump in mid-air, but I can´t find it… Any suggestions?


You could either activate the jump action twice if the jump is long pressed. OR
You could not use the platformer automation and use your own controls instead.