Time marches on, and careers come to an end.

The reality of that was driven home for Marc Staal this week when something he knew was happening finally did — his good buddy and longtime Rangers teammate Dan Girardi announced his retirement on Friday.

“The guys that we came up with, we’re obviously on the back half [of our careers],” Staal said before the Rangers’ 4-2 preseason loss to the Devils on Friday in Newark. “It’s going to be happening a lot more. When I talked to him, we started going back and reminiscing and stuff like that. But for me, in talking to him, I think he’s at peace, he’s happy about it, he seems very excited about it. And I was happy for him.

“He finally gets to carry on with the rest of his life and not take slapshots to the ankles anymore. So I’m sure he’s looking forward to that.”

Of course, that is the lasting image of Girardi during his 11 seasons with the Rangers, from signing as an undrafted free agent in 2006 until his contract was bought out in the summer of 2017 (the Rangers are still carrying $3.611 million of dead cap space this season, plus $1.11 million in each of the next three, through 2022-23).

Over 927 games in the league — the first 754 with the Rangers — plus an additional 143 in the playoffs, Girardi blocked so many shots that his ankles were always the size of grapefruits, his body was always pockmarked with regenerating bruises, and he never seemed to care or miss a big game.

“I bled Ranger blue and gave it my all for my team, the city and the Garden faithful,” Girardi, 35, said in a statement released by the team. “I gave my all every single night and left it all out on the ice. Now it’s time for the next chapter of my life to begin and I couldn’t be happier … and so is my body.”

Staal was there almost every step of the way, coming in a little differently as a first-round pick (No. 12 overall) and joining Girardi in 2007-08. They were together for the runs to three conference finals in four years, including a trip to the 2014 Stanley Cup final.

“He earned everything he got in the game,” Staal said. “I was happy and proud to be able to play with him for as long as I did — and in a Ranger uniform. That’s something we’ll have the rest of our lives.”

Staal, now 32, has two more years left on his deal that carries an annual salary-cap hit of $5.7 million. He is one of the few remaining Rangers from their oh-so-close years, along with Henrik Lundqvist, Chris Kreider and Jesper Fast. Even Ryan Callahan, one of the quintessential Black and Blueshirts, has been forced to stop playing due to a degenerative disk disease in his back.

But Staal remains with the Rangers as they enter this phase of youthful rejuvenation. There are youngsters all around him — and severe competition for ice time. The expectations are almost impossible to pin down, but the enthusiasm is not.

“It’s fun coming to the rink, getting to work,” Staal said, “and trying to build this thing to become a winning hockey team.”

For the past two seasons, the club sold off Staal’s veteran friends for future assets, something logically necessary, but emotionally difficult. After Staal had a decent first half this past season, his first under coach David Quinn, he faltered as the season once again frittered away into a spring with no playoffs.

“I thought he had a really good first half, and, not unlike a lot of our guys, especially our veterans, I think after the trade deadline, we lost a little bit of hope,” Quinn said. “It was a tough year for these guys.”

Now with one of his best friends retired, Staal plugs on, hoping he has a couple more good years left in the tank while helping the Rangers regain the prominence he remembers from when Girardi was beside him.

“Staalsy is excited,” Quinn said. “He looks good, he’s leaned up a little bit. And, you know, we’re going to need him.”