There are reasonable differences in opinion among travel planners when it comes to Lima. Some folks say to skip it altogether, while others find it fascinating. Let me find a middle ground…
For me, Lima is worth 24 hours of exploration. Your flight home will likely be a late-night affair anyways, so adding a night in Lima when returning from Cusco or Lake Titicaca at the end of your trip will provide closer to 30 hours to explore. Most importantly, that's at least four meals!
My strongest recommendation is to head to the Miraflores District to “eat your way through town.” Lima is a hub of fusion cuisine these days and boasts some truly great restaurants. Not all of them have to be fancy-schmancy, either. Enjoy ceviche, prepared right in front of you, while you enjoy clifftop views over the Pacific Ocean. Enjoy a restaurant focusing on Amazon cuisine. Try more alpaca steaks. Heck, you might want to insert an additional lunch or dinner into your schedule, just to take advantage of the options!
In between meals, take in the sunset from Parque del Amor, enjoy some shopping, try to count the cats in Kennedy Park, and take advantage of the easy access to tours that visit other parts of the city. Would I spend a week? No. But it is worth extending your trip slightly if you have the time.