octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cputime for Windows octave-2.9.16s is strange


From: David Bateman
Subject: Re: cputime for Windows octave-2.9.16s is strange
Date: Fri, 09 Nov 2007 10:01:34 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

cputime. tic and toc were moved to be built-in functions in 2.9.16 as
for times shorter than 20ms, if was the symbol table code for the
benchmarking code itself that was limiting the time resolution. That is
something like "tic; sum(ones(4,1)); toc" or "t=cputime();
sum(ones(4,1)); cputime()-t" was limited by the symbol table code for
the tic, toc and cputime functions whereas sum is a builtin.

When doing this it appears I made a mistake in the windows code.. I
believe the appropriate fix is the attached.

D.

-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

*** ./src/data.cc.orig11        2007-11-09 09:54:00.351056969 +0100
--- ./src/data.cc       2007-11-09 09:54:03.104904905 +0100
***************
*** 3276,3285 ****
    GetProcessTimes (hProcess, &ftCreation, &ftExit, &ftKernel, &ftUser);
  
    int64_t itmp = *(reinterpret_cast<int64_t *> (&ftUser));
!   usr = static_cast<double> (itmp) * 1e-1;
  
    itmp = *(reinterpret_cast<int64_t *> (&ftKernel));
!   sys = static_cast<double> (itmp) * 1e-1;
  
  #endif
  
--- 3276,3285 ----
    GetProcessTimes (hProcess, &ftCreation, &ftExit, &ftKernel, &ftUser);
  
    int64_t itmp = *(reinterpret_cast<int64_t *> (&ftUser));
!   usr = static_cast<double> (itmp) * 1e-7;
  
    itmp = *(reinterpret_cast<int64_t *> (&ftKernel));
!   sys = static_cast<double> (itmp) * 1e-7;
  
  #endif
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]