Changeset 76f37656 in rtems


Ignore:
Timestamp:
Feb 25, 2015, 7:52:10 PM (4 years ago)
Author:
Gedare Bloom <gedare@…>
Branches:
4.11, master
Children:
56c7192
Parents:
e50297e
git-author:
Gedare Bloom <gedare@…> (02/25/15 19:52:10)
git-committer:
Gedare Bloom <gedare@…> (03/04/15 20:38:52)
Message:

libcsupport: scale times() call to microseconds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/__times.c

    re50297e r76f37656  
    4444)
    4545{
    46   rtems_interval ticks;
     46  rtems_interval ticks, us_per_tick;
    4747  Thread_Control *executing;
    4848
     
    5555
    5656  ticks = rtems_clock_get_ticks_since_boot();
     57  us_per_tick = rtems_configuration_get_microseconds_per_tick();
    5758
    5859  /*
     
    9192      );
    9293      _Thread_Enable_dispatch();
    93       ptms->tms_utime = ticks_of_executing / 100;
     94      ptms->tms_utime = ticks_of_executing * us_per_tick;
    9495    }
    9596  #else
    9697    executing = _Thread_Get_executing();
    97     ptms->tms_utime  = executing->cpu_time_used;
     98    ptms->tms_utime  = executing->cpu_time_used * us_per_tick;
    9899  #endif
    99   ptms->tms_stime  = ticks;
     100  ptms->tms_stime  = ticks * us_per_tick;
    100101  ptms->tms_cutime = 0;
    101102  ptms->tms_cstime = 0;
    102103
    103   return ticks;
    104 } 
     104  return ticks * us_per_tick;
     105}
    105106
    106107/**
Note: See TracChangeset for help on using the changeset viewer.