Could it be Simulacron-3 by Daniel F. Galouye from 1964?
In the main character's world they have begun to create simulated worlds of their own, gradually various suspicious events drive him to the conclusion that his own world is a simulation too. It turns out that his appearance and personality are actually based on those of the "real" person running the simulation, the Operator, and the Operator isn't willing to just reprogram his memories or have him killed, but instead enjoys playing with him...
Meanwhile the Operator's lover is falling in love with the simulated version (the 'real' version has apparently become mad with power, so the simulated version reminds her of the man she originally fell in love with) and is trying to help him. Here's what she says about why the Operator let him live:
"It wasn't until yesterday," she went on, "that I realized he could
have solved his problem, as far as you were concerned, any time he
wanted, simply by reorienting you. But no. There was too much
perverted gratification to be had by letting you come close to
Fuller's secret, then pushing you away, steering you all the while
toward some such fate as he arranged for Collingsworth."
Eventually the simulated version is somehow able to overwrite the personality of the version in the "real" world, and wakes up there. You mentioned that the simulation is in realtime, that's true in this story:
"Even the Operator can't stay at it twenty-four hours a day. This
world is on a time-equivalent basis with the real one."
And you mentioned a scene where he's on a "slab" to interface with the virtual reality, here's the scene where he wakes up in the real world, though it sounds like more of a couch:
Confounded, I opened my eyes and was instantly confronted with the
effects of a strange room spread out all about me. Although it was a
room I had never seen before, I could recognize the simulectronic
nature of the equipment that filled almost all available space. I
glanced down and saw that I lay on a couch much like the one I had
used before while coupled with reactional units in Fuller's simulator.
I reached up and removed the empathy helmet, then sat staring
incomprehensively at it. There was a couch next to mine. Its leather
surface still bore the indentation of the person who had occupied it
-- for a long while, judging from the depth of the impression. On the floor nearby were
the shattered remains of another headpiece that had
evidently been dropped or hurled aside.
If this isn't the one, there are a number of other early virtual reality stories mentioned at the Encyclopedia of Science Fiction.