  Pulsars are rapidly rotating neutron stars emitting intense electromagnetic
radiation that is detected on Earth as regular and precisely timed pulses. By
exploiting their extreme regularity and comparing the real arrival times with a
theoretical model (pulsar timing), it is possible to deduce many physical
information, not only concerning the neutron star and its possible companion,
but also the properties of the interstellar medium, up to tests of General
Relativity. Last but not least, pulsars are used in conjunction with each other
as a galactic-sized detector for the cosmic background of gravitational waves.
In this paper, we investigate the effect of "matter" on the propagation time
delay of photons emitted by a pulsar orbiting a spinning black hole, one of the
most important relativistic effect in pulsar timing. We deduce an analytical
formula for the time delay from geodesic equations, showing how it changes as
the type of matter around the black hole (radiation, dust or dark energy)
varies with respect to previous results, where matter has not been taken into
account. It turns out that while the spin $a$ only induces a shift in the phase
of the maximum delay without increasing or decreasing the delay, the effect of
matter surrounding the black hole results in a noticeable alteration of it. Our
results show that dark energy would give the strongest effect and that,
interestingly, when the pulsar is positioned between the observer and the black
hole a slightly lower pulse delay than in the no-matter case appears. We
estimated these effects for SGR J1745-2900, the closest magnetar orbiting
SgrA*.
