After struggling in his opening match against Radu Albot, Federer would have wanted to produce a better display against Krajinovic but he dropped his serve early in the match.
However, the Swiss star responded quickly by breaking back and he broke Krajinovic again to win the first set 7-5.
And in the second set, Federer was at his very best as he asserted control on the match and eased through 6-3.
Speaking after the match to the ATP, Federer was asked if he was happy with how he executed his game plan and the 37-year-old said he was pleased with how he performed.
Federer said: “Yeah, especially [because] he’s been winning a lot of matches here and in Indian Wells.
“You can always feel that in a player like with Albot.
“They know what they want to do. They stay calm till the very end.
“They believe they can turn it around. But I was able to serve it out perfectly.
“I think it was a good second match for me.
“Much more humid so I’m happy I played through this kind of conditions.
“[And] I felt like I played a little bit better knowing the conditions.”