Timer to close form

I tried many different approaches to get a forms.alert from a hook to close itself after a few seconds:

for the base form

from pyrevit import forms, script, EXEC_PARAMS
warning_window = forms.alert("my message", title="Warning")


op = script.get_output()

and also

from time import sleep

and this

from time import sleep

and also

from time import sleep
EXEC_PARAMS.event_args.Cancel = True

to no avail.
I think I am missing the point.
I am guessing I need to somehow grab the window itself before being able to exit it.

any pointer in the right direction would be greatly appreciated.

Alert forms require interaction by nature as I understand it so you would have to send keys after a time to close it automatically. Would require import of PyAutoGUI or similar and complicate deployment though.

I picked forms.alert at first as it served my purpose well at the time.
Do you have another suggestion fo something that would a similar window where I could use a timer of some sort? @eprunty

I managed to get something out of a wpf.
beware of space at the end of each layout line
the space between the " and ’ is important

blahblah" '
# -*- coding: UTF-8 -*

from pyrevit import forms, script
import time

doc = __eventargs__.Document

### output section
output = script.get_output()

layout ='<Window ' \
        'xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ' \
        'xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ' \
        'Title="Test 1 2 1 2 " Height="150" Width="300"> ' \
        '<Grid> ' \
        '<TextBlock x:Name="textBlock" TextWrapping="Wrap" Text="this is the kind of text you might want to input" Margin="0,40,0,44"/> ' \
        '</Grid> ' \

w = forms.WPFWindow(layout, literal_string=True)