Joe Johnson of the Miami Heat drives against Carmelo Anthony...

Joe Johnson of the Miami Heat drives against Carmelo Anthony of the New York Knicks at Madison Square Garden on Sunday, Feb. 28, 2016. Credit: Jim McIsaac

Joe Johnson was penciled into Miami’s starting lineup before the Heat even began stitching the J-O-H-N-S-O-N on the back of his new red jersey.

Yeah, things move that quickly when a team wants a player as badly as the Heat wanted the former Nets swingman. At 5 p.m. Saturday, he was a free man, and by 5:01, he was part of the Heat. The negotiations were all ironed out and Johnson already had been told he was going to start against the Knicks on Sunday night.

“They told me . . . before I signed,” he said, adding that he hasn’t gotten much sleep since he accepted the Nets’ buyout on Thursday. “I’ve never joined a team midseason . . . but I’m up for it. It’s a challenge, and every game from here on out is going to be a playoff-type game for us.’’

Johnson shot 5-for-10 and had 12 points and three assists in 30:08 in the Heat’s 98-81 victory over the Knicks, not bad for someone who essentially was winging it. “I made a couple [mistakes], especially in the fourth, but just playing through your mistakes,’’ he said. “At the end of the day, it’s just basketball.”

Miami wanted him so badly that Dwyane Wade talked to Johnson “pretty much every day” in the weeks leading up to the buyout, Johnson said. So badly that coach Erik Spoelstra spent the pregame enumerating the various ways that Miami had coveted him from afar.

Spoelstra has no concerns about how Johnson will work within the Heat’s system and no worries about how other players will react to him, and he gave zero indication that Johnson, 34, will play the role of old man off the bench.

As for Johnson adapting to the new team . . . “We’ll adapt to him,” Spoelstra said. “We always hoped we’d have an opportunity to get him, and now it finally happened . . . We’re really excited about this . . . To acquire a player of Joe’s class, someone that we feel fits our personality, our DNA, our culture, and to get him at this time of the year, where we feel he’s been playing his best basketball in the last month, we feel terrific about it.”

After the game, Spoelstra called Johnson “a cerebral, experienced player” and added, “He’s a quick study.”

He’s also a clutch veteran who attracted the attention of a number of playoff-contending teams when he was bought out. The Cavaliers wanted him, the Raptors wanted him and the Thunder reportedly was interested, but although those teams likely would have been a better bet for Johnson to win the first NBA title in his 15-year career, he chose the Heat specifically because of the ties he has with Wade and others.

“These guys are fired up,” Spoelstra said of the reaction to Johnson’s acquisition. He recalled facing Johnson and the Hawks in the first round of the Eastern Conference playoffs in 2009, and “the scouting report was anybody but, anybody but Joe Johnson,” he said. “We were trapping him all over the court, and in Game 7, he finally figured it out and pulled his own version of Steph Curry. He went further out.” At least two of his six three-pointers, Spoelstra said with a little bit of awe, “were from 40 feet out,” and Johnson finished with 27 points.

Johnson said he’ll remember his time with the Nets fondly — probably in no small part because they set him free to join a contender. “The good outweighed the bad for me,” he said, “but I’d love to finish my career here” with the Heat.

It’s a relationship of mutual respect, and he’ll have plenty to do in his new home.

“He’s going to play a prominent role,” Spoelstra said. “There’s no time to wait . . . Whatever adjustment or adaptation we’ll need to make, we’ll make it.”