Mercurial > octave-nkf
comparison src/data.cc @ 10073:dcde57cb5778
use times module from gnulib
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 07 Jan 2010 17:26:18 -0500 |
parents | 184060864627 |
children | 4b270d1540f7 |
comparison
equal
deleted
inserted
replaced
10072:0b0bf1fd1ed7 | 10073:dcde57cb5778 |
---|---|
5698 seconds = ticks / HZ; | 5698 seconds = ticks / HZ; |
5699 | 5699 |
5700 sys = static_cast<double> (seconds) + static_cast<double>(fraction) / | 5700 sys = static_cast<double> (seconds) + static_cast<double>(fraction) / |
5701 static_cast<double>(HZ); | 5701 static_cast<double>(HZ); |
5702 | 5702 |
5703 #elif defined (__WIN32__) | |
5704 | |
5705 HANDLE hProcess = GetCurrentProcess (); | |
5706 FILETIME ftCreation, ftExit, ftUser, ftKernel; | |
5707 GetProcessTimes (hProcess, &ftCreation, &ftExit, &ftKernel, &ftUser); | |
5708 | |
5709 int64_t itmp = *(reinterpret_cast<int64_t *> (&ftUser)); | |
5710 usr = static_cast<double> (itmp) * 1e-7; | |
5711 | |
5712 itmp = *(reinterpret_cast<int64_t *> (&ftKernel)); | |
5713 sys = static_cast<double> (itmp) * 1e-7; | |
5714 | |
5715 #endif | 5703 #endif |
5716 | 5704 |
5717 retval (2) = sys; | 5705 retval (2) = sys; |
5718 retval (1) = usr; | 5706 retval (1) = usr; |
5719 retval (0) = sys + usr; | 5707 retval (0) = sys + usr; |