Shanghai high repetition rate X-ray-free electron laser (XFEL) and extreme light facility (SHINE) has been under construction. It aims at producing X-ray pulses in a photon energy range from 0.4 to 25 keV. To achieve the design goal, SHINE requires precise distribution and synchronization of the clock and timing signals over a long distance of approximately 3.1 km. Based on the standard White Rabbit (WR) protocol, a prototype of a high-precision clock and timing electronics is designed based on a customized clock frequency. Great attention is paid to the design of hardware and field programmable gate array (FPGA) logic to achieve high-precision clock synchronization, fine phase adjustment, and frequency tuning, as well as flexible shaping of timing signals. Test results indicate that the skew jitter of the clock signal is better than 20 ps within the frequency range from around 1 Hz to 1 MHz, and the clock phase delay can be adjusted with a step size of about 500 ps. As for the timing signals, the skew jitter is better than 40 ps rms. Moreover, the temperature drifts of the clock and timing signals are better than 3 ps/°C.