Time is the enemy of all sportsmen and women, and as Roger Federer exited the Australian Open on Thursday night the thought must have crossed his mind that this might just have been his last visit to a tournament he first played in 2000 and first won four years later.

Champions, though, have short memories when it comes to losses and his 7-6 (1), 6-4, 6-3 semi-final defeat by Novak Djokovic is unlikely to linger, especially since his niggling groin injury meant he knew his chances of victory were somewhere between slim and none.

At 38, the days when he dominated the Tour are well behind him but the belief still remains strong that he can add to his record tally of 20 grand slam titles – a mark in danger of being erased, sooner rather than later, by Rafael Nadal, who has 19, or Djokovic, who is now one win away from his 17th. “I do believe that,” Federer said. “I think by having the year that I had last year, also with what I have in my game, how I’m playing, I do feel that, yeah.”

It is six months, after all, since Federer so nearly won his ninth Wimbledon title, missing two match points in the final against Djokovic. To him, 38 probably does not feel much different to 36, when he won his 20th grand slam title here. “You never know what the future holds,” he said. “But especially my age, you don’t know. I’m confident. I’m happy how I’m feeling, to be honest. I got through a good, nice training block. No plans to retire. From that standpoint we’ll see how the year goes, how everything is with the family. We’ll go from there. Of course, I hope to be back.”

But playing in pain is no fun. Having pushed his body to the limit in beating John Millman in a final-set tie‑break in the third round and then picking up the injury against Tennys Sandgren in the quarter-finals, Federer was determined to play, even though he had agreed with his team that if the injury worsened he would stop – something he has never done in his career. Entering his 50th meeting with Djokovic with very little chance of winning was a difficult pill to swallow.

“Overall, at the end of the day I guess I’m very happy. I’ve got to be happy with what I achieved. It was the maximum to go to get at this tournament, especially after the Millman and the Sandgren match. [But] today was horrible, to go through what I did. Nice entrance, nice send-off, and in between is one to forget because you know you have a 3% chance to win. You know, got to go for it. You never know. But once you can see it coming, that it’s not going to work any more, it’s tough.”

Federer’s other regret on the night was not being able to close out the first set, having led 4-1, and 0-40 on the Djokovic serve as the Serb, seven times the champion here, found himself trying to gauge the level of Federer’s fitness rather than focusing on his own game.

At 5-3, he could not serve out the set and Djokovic took the tie‑break, before pulling away to set up a final against Dominic Thiem or Alexander Zverev.

“I was playing with nothing to lose,” he said. “I was just trying to take big cuts at the ball, trying to keep the rallies to a minimum, make sure I keep him off guard, mix it up as much as I can.

“I returned really well in the beginning. Got some really good connections going. Unfortunately I was not able to serve it out. To be honest, I feel like I should have found a way to do that, but wasn’t able to.”