Time between GetKeyDown and Up

So, I am fairly new to Unity (and C#). I’m trying to make a very basic 2D platformer. I want to make the character jump higher if I hold the button down longer.
So I was thinking about having a jump height float and multiplying it by the time I held the jump button down for.
So my question is: how can I reference the time that passes between GetKeyDown and GetKeyUp? Is it possible?
If not, is there a simple way to get the same effect?

In its simplest form:

private float timeDown = -1f;
void Update() {
if (Input.GetKeyDown(KeyCode.Space) ) timeDown = Time.time;
if (Input.GetKeyUp(KeyCode.Space) ) Debug.Log("Space was held for "+(Time.time - timeDown).ToString("#.00")+" seconds");
}