Wireless Sensor Networks (WSN) can be part of a tremendous number of applications. Many WSN applications require real-time communication where the sensed data have to be delivered to the sink node within a predetermined deadline decided by the application. In WSNs, the sensor nodes' constrained resources (e.g. memory and power) and the lossy wireless links, give rise to significant difficulties in supporting real-time applications. In addition, many WSN routing algorithms strongly emphasize energy efficiency, while delay is not the primary concern. Thus, WSNs desperately need new routing protocols that are reliable, energy-efficient, and appropriate for real-time applications. The proposed algorithm is a real-time routing algorithm appropriate for delay-sensitive applications in WSNs. It has the ability to deliver data on time while also enabling communications that are reliable and energy-efficient. It achieves this by deciding which candidate neighbors are eligible to participate in the routing process and can deliver the packet before its deadline. In order to lessen the delay of the chosen paths, it also computes the relaying speed for each eligible candidate. Moreover, it takes into account link quality, hop count, and available buffer size of the selected relays, which leads to end-to-end delay reduction while also minimizing energy consumption. Finally, it considers the node's energy consumption rate when selecting the next forwarder to extend the network lifetime. Through simulation experiments, the proposed algorithm has shown improved performance in terms of packet delivery ratio, network lifetime packets miss ratio, average end-to-end delay, and energy imbalance factor.