RPM's surge after engine runs 3-5 min Idle to 800 over ,then back to Idle on 1996 Honda Civic

After 3-5 min when car is starts a regular up & down on RPMs, not many maybe 500-800 increase then back to fault codes that would explain it, one o2 sensor,but it did it before that fault came up..12-18 months now..

Asked by for the 1996 Honda Civic