<varlistentry>
<term>
<command>
+ <option>time_in_seconds</option>
+ </command>
+ </term>
+ <listitem>If true, variables that output times output a number
+ that represents seconds. This doesn't affect $time, $tztime and
+ $utime
+ <para /></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
<option>top_cpu_separate</option>
</command>
</term>
#endif
static unsigned int top_name_width = 15;
int output_methods;
+char times_in_seconds = 0;
static int extra_newline;
enum x_initialiser_state x_initialised = NO;
static volatile int g_signal_pending;
}
#endif /* X11 */
OBJ(uptime_short) {
- format_seconds_short(p, p_max_size, (int) cur->uptime);
+ if(times_in_seconds) {
+ snprintf(p, p_max_size, "%d", (int) cur->uptime);
+ } else {
+ format_seconds_short(p, p_max_size, (int) cur->uptime);
+ }
}
OBJ(uptime) {
- format_seconds(p, p_max_size, (int) cur->uptime);
+ if(times_in_seconds) {
+ snprintf(p, p_max_size, "%d", (int) cur->uptime);
+ } else {
+ format_seconds(p, p_max_size, (int) cur->uptime);
+ }
}
#ifdef __linux__
OBJ(user_names) {
draw_outline = string_to_bool(value);
}
#endif /* X11 */
+ CONF("times_in_seconds") {
+ times_in_seconds = string_to_bool(value);
+ }
CONF("out_to_console") {
if(string_to_bool(value)) {
output_methods |= TO_STDOUT;