Well, there's a few challenges here, crawl action time is really weird, and also *player* actions take varying amount of time.
You'd have to first of all decide:
1. What does it mean if a player does a fast action vs a slow one, does the game prevent you from taking your next action until an appropriate amount of time has passed (What does auto explore do, just click away slowly, are you forced to wait, or does the game speed up with fast player input?)
2. How much time *does* pass per "tick" of inactivity, is it 1.0 Auts? Some other value?
Once you'd decided that, then it'd require you put some sort of timing/event handler or something (there's lots of choices here) that would spin up and run through crawl's main "tick" function every so often, (also possibly another one to unlock the player from taking his next action, if you were going that route, and potentially disconnect the player's action from the firing of the main event loop, again depending on how you were designing it.
Now all of that presumes that you want to preserve crawl's odd step-wise simulation of time, which approximately goes like this:
- Code:
Player takes an action that takes X time,
add X to all the monster's action energy queues,
loop through all the monsters, for each one, if energy is greater than their speed, subtract their speed, take an action, add them to the end of the cycle of things looped through
So of course this means that monsters can get multiple actions *all at the same time* on each heartbeat, which is fine for a turn-based game (what else is it going to do) but is somewhat weird when you throw timing into the loop.
So then if you want to make it more-correctly have monsters take actions *at an appropriate time* instead of all in a chunk between player actions, then you have to construct that action queue very very differently, which either involves a whole large complicated structure to track all the possible waits for all the times that the next thing would fire up and act, or (much more simply, although causing a lot more overhead) a much faster heartbeat that simply checked what needed doing over and over again at frequent intervals.
Overall, it'd probably take me, personally, half a day to a day to do something like that and get it working to my satisfaction, given that I wanted to do so and had a clear idea of which thing it was that I wanted to do, and I had sufficient motivation to do it.