The Shapiro time delay effect, or gravitational time delay effect, is one of the four classic solar-system tests of general relativity. Radar signals passing near a massive object take slightly longer to travel to a target and longer to return than they would if the mass of the object were not present. The time delay is caused by spacetime dilation, which increases the time it takes light to travel a given distance from the perspective of an outside observer. In a 1964 article entitled Fourth Test of General Relativity, Shapiro wrote: 
Because, according to the general theory, the speed of a light wave depends on the strength of the gravitational potential along its path, these time delays should thereby be increased by almost 2×10−4 sec when the radar pulses pass near the sun. Such a change, equivalent to 60 km in distance, could now be measured over the required path length to within about 5 to 10% with presently obtainable equipment.
Throughout this article discussing the time delay, Shapiro uses c as the speed of light and calculates the time delay of the passage of light waves or rays over finite coordinate distance according to a Schwarzschild solution to the Einstein field equations.
The time delay effect was first predicted in 1964, by Irwin Shapiro. Shapiro proposed an observational test of his prediction: bounce radar beams off the surface of Venus and Mercury and measure the round-trip travel time. When the Earth, Sun, and Venus are most favorably aligned, Shapiro showed that the expected time delay, due to the presence of the Sun, of a radar signal traveling from the Earth to Venus and back, would be about 200 microseconds,  well within the limitations of 1960s-era technology.
The first tests, performed in 1966 and 1967 using the MIT Haystack radar antenna, were successful, matching the predicted amount of time delay.  The experiments have been repeated many times since then, with increasing accuracy.
In a nearly static gravitational field of moderate strength (say, of stars and planets, but not one of a black hole or close binary system of neutron stars) the effect may be considered as a special case of gravitational time dilation. The measured elapsed time of a light signal in a gravitational field is longer than it would be without the field, and for moderate-strength nearly static fields the difference is directly proportional to the classical gravitational potential, precisely as given by standard gravitational time dilation formulas.
Shapiro's original formulation was derived from the Schwarzschild solution and included terms to the first order in solar mass (M) for a proposed Earth-based radar pulse bouncing off an inner planet and returning passing close to the Sun: 
where d is the distance of closest approach of the radar wave to the center of the Sun, xe is the distance along the line of flight from the Earth-based antenna to the point of closest approach to the Sun, and xp represents the distance along the path from this point to the planet. The right-hand side of this equation is primarily due to the variable speed of the light ray; the contribution from the change in path, being of second order in M, is negligible. O is the Landau symbol of order of error.
For a signal going around a massive object, the time delay can be calculated as the following:[ citation needed]
Using Δx = cΔt, this formula can also be written as
which is a fictive extra distance the light has to travel. Here is the Schwarzschild radius.
In PPN parameters,
which is twice the Newtonian prediction (with ).
The doubling of the Shapiro factor can be explained by the fact that there is not only the gravitational time dilation, but also the stretching of space, both of which contribute equally in general relativity for the time delay as they also do for the deflection of light.
From the nearly simultaneous observations of neutrinos and photons from SN 1987A, the Shapiro delay for high-energy neutrinos must be the same as that for photons to within 10%, consistent with recent estimates of the neutrino mass, which imply that those neutrinos were moving at very close to the speed of light. After the direct detection of gravitational waves in 2016, the one-way Shapiro delay was calculated by two groups and is about 1800 days. In general relativity and other metric theories of gravity, though, the Shapiro delay for gravitational waves is expected to be the same as that for light and neutrinos. However, in theories such as tensor–vector–scalar gravity and other modified GR theories, which reproduce Milgrom's law and avoid the need for dark matter, the Shapiro delay for gravitational waves is much smaller than that for neutrinos or photons. The observed 1.7-second difference in arrival times seen between gravitational wave and gamma ray arrivals from neutron star merger GW170817 was far less than the estimated Shapiro delay of about 1000 days. This rules out a class of modified models of gravity that dispense with the need for dark matter.