It takes perhaps a few square millimeters if it's SMD, and if it's through-hole/old style components you'll always be able to fit an R and a C piggy-backed to each other somewhere in the space of your case. So this sounds like a bit of a poor excuse really ![]()
This sounds like performance problems with your code in general, suggesting that there just may be (I'm putting this very conservatively...) opportunities for overall performance improvements that could make your life easier.
Perhaps it's time to post a schematic and/or picture of the contraption as well as some sketch code so it becomes easier to determine which solution is appropriate. It prevents a lot of back-and forth with solutions and the "yes, but..."'s.