This is a sample canister smart contract code written in Rust uses the heartbeat functionality.
ericswanson-dfinity/heartbeat-example
A simple example of how to use the heartbeat functionality in rust canister smart contracts on the Internet Computer
RustMIT