There may be other opinions, but I think both your sentences are fine. Each is always followed by a singular verb in my grammar if it is the subject. A genitive need not denote possession: two miles' walk is perfectly good English albeit less common than a two-mile walk.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.