– Just mere days ago, the Timberwolves swept a five-game homestand and won for the 12th time in their past 15 games.

Now after a winless trip that took them to Orlando and Houston, they’re attempting again to avoid a three-game losing streak.

They’ve done so four times already this season and haven’t lost more than two consecutive games, a big reason why they’re 29-18 and fourth in the Western Conference.

Now they’ve lost to a Magic team that had won once since Dec. 6 and were beaten 116-98 Thursday by a Rockets team the Wolves could see in the playoffs if they’re serious about a springtime run.

Their next four opponents — three games on the road — all possess winning records, starting with Saturday’s home game against Toronto. They leave again Sunday for a challenging three-game trip west to play the Los Angeles Clippers, Portland and mighty Golden State. Times do change, in a matter of days.

“We just talked about that,” Wolves coach Tom Thibodeau said after Thursday’s loss. “Things can change very quickly in this league. We went from winning five in a row and now we’ve slipped, and we’ve got to play with more of an edge and we have to bounce back. The games keep coming.”

The last time the Wolves lost consecutive games, they returned from Brooklyn and Boston and soundly beat a rested New Orleans team at Target Center the next night.

Until then, they hadn’t lost consecutive game since before Thanksgiving, when they followed losses to Detroit and at Charlotte by beating Orlando at home.

“We’ve done a good job of bouncing back, understanding we can’t lose games in a row for us to be the team we want to be,” Wolves center Karl-Anthony Towns said. “You put yourself in dangerous position for the playoffs by losing two in a row. We’ve done a good job so far not doing that.”

On Saturday, they play a Raptors team that is second in the Eastern Conference and 31-13 after Friday’s 86-83 win over San Antonio at home. The Wolves are 18-6 at Target Center and have won their past eight games there, the franchise’s longest such single-season streak since 2004.

After that, they play a Clippers team that has just won eight of its past 10 games on their way to Portland and Golden State.

“Every stretch we’ve been having in January is testing,” Towns said. “The five-game homestand was testing, but we did a good job holding the fort down. No matter who we play, where we play, if we go out and execute the way we know how to, I’ll take us against anybody.”

The Wolves attributed a lack of energy and urgency to Tuesday’s lousy loss at Orlando. They lamented their inability to take away either Houston’s inside or outside game Thursday.

The Rockets simply outplayed them, shooting them out of Toyota Center with a 17-9 difference in three-pointers made and finishing each of the first three quarters with dizzying flourishes.

They did so while working superstar James Harden back into the lineup with a rare 10-point night after seven games away injured.

No matter because teammates Chris Paul, Eric Gordon and Clint Capela pushed the Rockets onward. Houston outscored the Wolves a combined 31-7 to finish the three quarters.

“When a team shoots threes the way they do — and that’s the way of our league — if you have one or two bad minutes, that’s 10 points,” Thibodeau said. “You have to play with a lot of toughness. You can’t play for eight minutes and then rest. Wins are hard to come by. This is an elite team. Their record says how good they are. Their numbers say how good they are.”

Afterward, Thibodeau called the resounding loss to such an elite team “good” because it reveals how much work remains.

“It gives us a reminder what a really, really good team looks like and the way they play,” Wolves star Jimmy Butler said about the loss to Houston. “And if you don’t play hard and don’t do what we talk about before the game, what our team looks like.

“We need to learn from this quickly and not let this have a snowball effect.”