その手の平は尻もつかめるさ

ギジュツ的な事をメーンで書く予定です

Released lua-cputime

I had released lua-cputime.

github.com

This package also had been shipped to luarocks.

luarocks.org

This library provides functions to measure the CPU time (i.e. user time and system time). The lua runtime doesn't support such functions, so this library bridges to native C's sys/time.h and sys/resource.h and expose getrusage() function as get_process_cputime(), get_children_process_cputime() and get_thread_cputime() *1.

As you can see, this library doesn't support the Windows environment because it associate to sys/time.h and sys/resource.h. I have a will to support the Windows, but I'm not familiar with that. I'm happy if a patch is sent.




[following description is outdated; the implementation has been changed]

This library provides a function to measure the CPU time (i.e. utime, stime, cutime and cstime). The lua runtime doesn't support such function, so this library bridges to native C's sys/times.h and expose times() function as get_cputime().
As you can see, this library doesn't support the Windows environment because it bridges sys/times.h. I have a will to support the Windows, but I'm not familiar with that. I'm happy if a patch is sent.

*1:`get_thread_cputime()` is only supported by Linux