Hi envel.
There is no one answer to your inquiry.
How representative of real life does your simulation need to be?
You can use a mathematical equation to represent the throttle / rpm relationship, or use physical equations to determine the same.
Both can be very simple or become very complicated.
The simplest mathematical is just using a direct ratio equation, ie RPM = THROTTLE_MAX times X, where X is the fraction of the throttle opening rangine from 0 to 1.
In which case, the rate of change of the engine's rpm becomes instantaneous.
The next simplest mathematical is using a time loop on a linear equation, basically y = mx + b, and one justs counts up the slope from the known Starting RPM and Starting Throttle Position to the known Final RPM and Final Throttle Postion by increments of time t, comparing whether or not you have arrived at the Final RPM.
Becoming more complicated, you can modify the linear equation to a power function, exponential, quadratic, sine, etc. or parts therof and/or combinations to get what you want to look like is real, such as when you really step on it, or going up or down a hill, or where you are at the throttle position.
Is the time loop the only way to do it - not sure at the moment.
Physical equations involve torque, mass, load, in which case you need to know something about your car and its performance. The "something" can be as simple or as complicated as you wish.
That is of course, just a pre-amble answer, and no doubt there are better and best ways to proceed, so as to minimize computing power, that people have found out.
Even so, you might like to experiment to see just how different mathematical equations in a time loop affect you car, if you ar the curious type.