time.c (1591) | time.c (11873) |
---|---|
1/* 2 * Copyright (c) 1987, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 89 unchanged lines hidden (view full) --- 98 after.tv_sec--, after.tv_usec += 1000000; 99 fprintf(stderr, "%9ld.%02ld real ", after.tv_sec, after.tv_usec/10000); 100 fprintf(stderr, "%9ld.%02ld user ", 101 ru.ru_utime.tv_sec, ru.ru_utime.tv_usec/10000); 102 fprintf(stderr, "%9ld.%02ld sys\n", 103 ru.ru_stime.tv_sec, ru.ru_stime.tv_usec/10000); 104 if (lflag) { 105 int hz = 100; /* XXX */ | 1/* 2 * Copyright (c) 1987, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 89 unchanged lines hidden (view full) --- 98 after.tv_sec--, after.tv_usec += 1000000; 99 fprintf(stderr, "%9ld.%02ld real ", after.tv_sec, after.tv_usec/10000); 100 fprintf(stderr, "%9ld.%02ld user ", 101 ru.ru_utime.tv_sec, ru.ru_utime.tv_usec/10000); 102 fprintf(stderr, "%9ld.%02ld sys\n", 103 ru.ru_stime.tv_sec, ru.ru_stime.tv_usec/10000); 104 if (lflag) { 105 int hz = 100; /* XXX */ |
106 long ticks; | 106 u_long ticks; |
107 108 ticks = hz * (ru.ru_utime.tv_sec + ru.ru_stime.tv_sec) + 109 hz * (ru.ru_utime.tv_usec + ru.ru_stime.tv_usec) / 1000000; | 107 108 ticks = hz * (ru.ru_utime.tv_sec + ru.ru_stime.tv_sec) + 109 hz * (ru.ru_utime.tv_usec + ru.ru_stime.tv_usec) / 1000000; |
110 111 /* 112 * If our round-off on the tick calculation still puts us at 0, 113 * then always assume at least one tick. 114 */ 115 if (ticks == 0) 116 ticks = 1; 117 |
|
110 fprintf(stderr, "%10ld %s\n", 111 ru.ru_maxrss, "maximum resident set size"); 112 fprintf(stderr, "%10ld %s\n", 113 ru.ru_ixrss / ticks, "average shared memory size"); 114 fprintf(stderr, "%10ld %s\n", 115 ru.ru_idrss / ticks, "average unshared data size"); 116 fprintf(stderr, "%10ld %s\n", 117 ru.ru_isrss / ticks, "average unshared stack size"); --- 23 unchanged lines hidden --- | 118 fprintf(stderr, "%10ld %s\n", 119 ru.ru_maxrss, "maximum resident set size"); 120 fprintf(stderr, "%10ld %s\n", 121 ru.ru_ixrss / ticks, "average shared memory size"); 122 fprintf(stderr, "%10ld %s\n", 123 ru.ru_idrss / ticks, "average unshared data size"); 124 fprintf(stderr, "%10ld %s\n", 125 ru.ru_isrss / ticks, "average unshared stack size"); --- 23 unchanged lines hidden --- |