Obviously the things you should take into consideration are your room rate, etc, whether you can get a late check out. There's definitely enough to do: tour city center, look at the fountain park at night for an hour or two, have a long lunch at one of Lima's amazing restaurants (most places close for Sunday dinner, with the exception of Huaca Pucllana).
We recently had a flight at 10:30PM, but was granted a 4:00PM late check out at the Four Points Miraflores due to Platinum status. However, if I was checking out at 10:00PM I would have gladly spent an extra U$110 in order to have a room available to freshen up and get a little break in the middle of the day.