1. An ultrasonic diagnostic apparatus, comprising: an ultrasonic probe; a displacement generator that displaces an inside of a subject, and generates a shear wave; a detector that transmits an ultrasonic beam from the ultrasonic probe to a first detection position at a high time resolution of the subject and receives a first reflection signal, detects a first displacement at the first detection position on a basis of the first reflection signal, transmits the ultrasonic beam to a second detection position farther than the first detection position on a basis of a position where the shear wave is generated, and receives a second reflection signal, and detects a second displacement at the second detection position on a basis of the second reflection signal; and a controller that calculates a velocity of the shear wave on a basis of the first displacement and the second displacement, and outputs hardness information of the subject, wherein the detector transmits the ultrasonic beam to the second detection position in response to receiving a signal, from the controller, which designates the second detection position, wherein the controller sends the signal, to the detector, which designates the second detection position in response to the controller calculating the first displacement at the first detection position and detecting a peak value of the first displacement by signal processing, wherein the controller dynamically switches the first detection position at which the first displacement is detected to the second detection position at which the second displacement is detected in response to an analysis result of a first time at which a displacement of tissue of the subject caused by the shear wave peaks at the first detection position, wherein the dynamically switching the first detection position at which the first displacement is detected to the second detection position at which the second displacement is detected includes the detector switching a detection time at which the ultrasonic beam for displacement detection is transmitted to each of the detection positions in response to the analysis result, wherein the controller switches a plurality of detection positions by utilizing an output of the detector, wherein the controller sets a detection time at the plurality of detection positions on the basis of the output of the detector, wherein the controller sets a second time at which the ultrasonic beam is transmitted to the second detection position dependent on the analysis result of the shear wave at the first detection position by the detector, and wherein a starting time of the transmitting the ultrasonic beam and the receiving first reflection signal to/from a detection position at or after an n-th detection position is determined by the controller by utilizing a peak detection estimation time estimated from a detection result of a peak of the shear wave detected at a detection position before the n-th detection position, wherein n>1.