Changeset 5fbc1f9 in mainline


Ignore:
Timestamp:
2019-01-10T20:51:25Z (5 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
51a04bd
Parents:
c2db02a
Message:

libc: stopwatch API symmetry

Location:
uspace/lib/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/perf.h

    rc2db02a r5fbc1f9  
    6464 * @param nanos Elapsed time in nanoseconds to set.
    6565 */
    66 static inline void stopwatch_set_elapsed(stopwatch_t *stopwatch, nsec_t nanos)
     66static inline void stopwatch_set_nanos(stopwatch_t *stopwatch, nsec_t nanos)
    6767{
    6868        stopwatch->start.tv_sec = 0;
  • uspace/lib/c/test/perf.c

    rc2db02a r5fbc1f9  
    6666{
    6767        stopwatch_t sw = STOPWATCH_INITIALIZE_STATIC;
    68         stopwatch_set_elapsed(&sw, 42);
     68        stopwatch_set_nanos(&sw, 42);
    6969        PCUT_ASSERT_INT_EQUALS(42, (int) stopwatch_get_nanos(&sw));
    7070}
     
    7474{
    7575        stopwatch_t sw = STOPWATCH_INITIALIZE_STATIC;
    76         stopwatch_set_elapsed(&sw, 4200000000021);
     76        stopwatch_set_nanos(&sw, 4200000000021);
    7777        PCUT_ASSERT_EQUALS(4200000000021, (long long) stopwatch_get_nanos(&sw));
    7878}
Note: See TracChangeset for help on using the changeset viewer.