Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
February 10, 2013 D timer | ||||
---|---|---|---|---|
| ||||
Can i do my own timer in D console application? like in C# timer_Tick event. |
February 10, 2013 Re: D timer | ||||
---|---|---|---|---|
| ||||
Posted in reply to SaltySugar | On Sunday, 10 February 2013 at 14:49:15 UTC, SaltySugar wrote:
> Can i do my own timer in D console application?
> like in C# timer_Tick event.
There is no Timer in D as you know it from C# and also there are no events. You must rely on SetTimer WinAPI and write your own TimerProc.
|
February 10, 2013 Re: D timer | ||||
---|---|---|---|---|
| ||||
Posted in reply to SaltySugar | Am 10.02.2013 15:49, schrieb SaltySugar: > Can i do my own timer in D console application? > like in C# timer_Tick event. Not sure what you mean, but I have a pretty solid Timer implementation (Threaded) https://github.com/Dav1dde/BraLa/blob/master/brala/utils/thread.d The file has no dependencies, so copy it over and have fun. License of the whole application is GPLv3, but if you need it relicensed drop me an e-mail or notify me somehow |
February 26, 2013 Re: D timer | ||||
---|---|---|---|---|
| ||||
Posted in reply to SaltySugar | On Sunday, 10 February 2013 at 14:49:15 UTC, SaltySugar wrote: > Can i do my own timer in D console application? > like in C# timer_Tick event. I have also created one. Please, see here: https://bitbucket.org/heromyth/dtoolkit/src/a8b5f8874e3d82373b71a2ca5c9f02a73362b56a/toolkit/System/Timer.d?at=default It ported from http://www.codeproject.com/Articles/98346/Microsecond-and-Millisecond-NET-Timer |
February 26, 2013 Re: D timer | ||||
---|---|---|---|---|
| ||||
Posted in reply to David | David:
> Not sure what you mean, but I have a pretty solid Timer implementation
> (Threaded)
>
> https://github.com/Dav1dde/BraLa/blob/master/brala/utils/thread.d
>
> The file has no dependencies, so copy it over and have fun. License of
> the whole application is GPLv3, but if you need it relicensed drop me an
> e-mail or notify me somehow
It's a common need. So maybe it's a good idea to put a version of that code in Phobos.
Bye,
bearophile
|
February 27, 2013 Re: D timer | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | Am 26.02.2013 14:19, schrieb bearophile:
> David:
>
>> Not sure what you mean, but I have a pretty solid Timer implementation
>> (Threaded)
>>
>> https://github.com/Dav1dde/BraLa/blob/master/brala/utils/thread.d
>>
>> The file has no dependencies, so copy it over and have fun. License of the whole application is GPLv3, but if you need it relicensed drop me an e-mail or notify me somehow
>
> It's a common need. So maybe it's a good idea to put a version of that code in Phobos.
>
> Bye,
> bearophile
I asked a while ago on the main NG if I should make it phobos compatible, answer was no.
|
Copyright © 1999-2021 by the D Language Foundation