Save chronometer when reloading the page

Iโ€™m currently doing a clock in and out for users that starts a chronometer when logging in, the issue that I have is that I want to save that live chronometer when reloading the page, donโ€™t know what could be a recommendation to save live chronometer
Just a small snippet of my code:

for hour in range(24):
                    for minute in range(60):
                        for segs in range(60):
                            timer = "{:02d}:{:02d}:{:02d}".format(hour,minute,segs)
                            st.markdown(f'<p class="big-font-hour">{timer}</p>', unsafe_allow_html=True)
                            time.sleep(1)

Hi @Carlos1,

Thanks for posting!

Streamlit apps by default execute from start to finish when the page is refreshed โ€“ that said, it sounds like you could get close to what youโ€™re describing by using a combination of session state and caching.

Caroline :balloon:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.