Timer

David d at dav1d.de
Mon Feb 17 03:42:31 PST 2014


Am 17.02.2014 12:20, schrieb Chris:
> On Monday, 17 February 2014 at 11:11:06 UTC, simendsjo wrote:
>> On Monday, 17 February 2014 at 11:08:16 UTC, Chris wrote:
>>> The D way of implementing a timer? I need to (automatically) execute
>>> a function that performs a clean up, say every hour.
>>>
>>> if (file.older than 1 hour) {
>>>    remove;
>>> }
>>
>> Vibe.d can be used for this to get an OS agnostic solution.
>> Haven't used it myself, but this function seems to be what you are
>> looking for:
>> https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/core.d#L342
>>
> 
> Great, it's for a vibe.d project anyway, it might do the trick.
> 
> Out of interest, if there's a phobos way, let me know.

https://github.com/Dav1dde/BraLa/blob/master/brala/utils/thread.d#L50-L95


More information about the Digitalmars-d-learn mailing list