digitalmars.D.learn - Measuring ticks (or time) per threads
- Phil (7/7) Dec 04 2013 Hi guys,
- Rob T (14/21) Dec 04 2013 The D core.thread lib could certainly have more functions added
- Phil (5/28) Dec 04 2013 That function sounds great. Unfortunately I am working on Windows
- Rob T (5/9) Dec 04 2013 You may find something in core.sys.windows.windows.d. My
- Rob T (4/4) Dec 04 2013 Also please post a bug or enhancement issue for anything that you
- Phil Lavoie (2/6) Dec 05 2013 Done
Hi guys, I'd like to know if there is a way using the stdlib that I can measure the number of ticks that a thread has been working. I do mean the number of ticks that it has been ACTIVE, and not the noTicks since its creation. Thanks! Phil
Dec 04 2013
On Wednesday, 4 December 2013 at 20:12:41 UTC, Phil wrote:Hi guys, I'd like to know if there is a way using the stdlib that I can measure the number of ticks that a thread has been working. I do mean the number of ticks that it has been ACTIVE, and not the noTicks since its creation. Thanks! PhilThe D core.thread lib could certainly have more functions added to it. If you are using a posix compatible OS, check out core.sys.posix.sys.resource; Use this function to get runtime stats int getrusage(int, rusage*); For usage details, consult the manpage http://linux.die.net/man/2/getrusage The times returned are in seconds+msec but you can convert to approx ticks using conversion functions in core.clock. As for Windows, I have no idea how to get this information, but there's probably a way. --rt
Dec 04 2013
On Wednesday, 4 December 2013 at 22:55:46 UTC, Rob T wrote:On Wednesday, 4 December 2013 at 20:12:41 UTC, Phil wrote:That function sounds great. Unfortunately I am working on Windows so I guess I'll have to look into their API. I was hoping for a solution available in the std but if there isn't than there isn't. Thanks for you information!Hi guys, I'd like to know if there is a way using the stdlib that I can measure the number of ticks that a thread has been working. I do mean the number of ticks that it has been ACTIVE, and not the noTicks since its creation. Thanks! PhilThe D core.thread lib could certainly have more functions added to it. If you are using a posix compatible OS, check out core.sys.posix.sys.resource; Use this function to get runtime stats int getrusage(int, rusage*); For usage details, consult the manpage http://linux.die.net/man/2/getrusage The times returned are in seconds+msec but you can convert to approx ticks using conversion functions in core.clock. As for Windows, I have no idea how to get this information, but there's probably a way. --rt
Dec 04 2013
On Thursday, 5 December 2013 at 00:53:00 UTC, Phil wrote:That function sounds great. Unfortunately I am working on Windows so I guess I'll have to look into their API. I was hoping for a solution available in the std but if there isn't than there isn't. Thanks for you information!You may find something in core.sys.windows.windows.d. My understanding is that it's not a full interface into the windows API, but enough may be there. --rt
Dec 04 2013
Also please post a bug or enhancement issue for anything that you think ought to be included in the standard libs that isn't. https://d.puremagic.com/issues/ --rt
Dec 04 2013
On Thursday, 5 December 2013 at 06:22:35 UTC, Rob T wrote:Also please post a bug or enhancement issue for anything that you think ought to be included in the standard libs that isn't. https://d.puremagic.com/issues/ --rtDone
Dec 05 2013