A variable valve timing controller adjusts valve timing of an intake valve
and/or an exhaust valve by varying a motor speed relative to a camshaft.
When an engine is running under a predetermined condition, an actual
valve timing is calculated based on a cam angle signal and crank angle
signal every when the cam angle signal is inputted. A final valve timing
is calculated by adding a valve timing variation amount to the actual
valve timing at the time the cam angle signal is outputted. The valve
timing amount is periodically calculated based on a difference between a
motor speed and a rotational speed of the intake camshaft. When the
engine is running under another condition, only actual valve timing at
the time the cam angle signal is outputted is calculated.