`time` is a command line utility for running another program and summarizing resource usage

learn more… | top users | synonyms

0
votes
1answer
39 views

Deleting a file after X days does not work [duplicate]

I've tried multiple ways of writing this and I'm executing the script myself so it isn't the crontab that isn't working. These are examples of what I've tried : find /home/backups -mtime +1 -exec rm {...
32
votes
6answers
78k views

How to measure time of program execution and store that inside a variable

In order to find out how long certain operations within a Bash (v4+) script take, I would like to parse the output from the time command "separately" and (ultimately) capture it within a Bash variable ...
4
votes
3answers
6k views

Find last shutdown time

This is the command I am using: last -x|grep shutdown | head -1 but it's giving me the duration with +2 hours: shutdown system down 3.14-1-amd64 Mon Jul 21 08:43 - 22:19 (13:36) the last ...
5
votes
4answers
453 views

How to measure Firefox's startup time?

I would like to measure how much time it takes for some softwares to start. I know the command time but in the case of firefox (iceweasel for me on Debian), this command prints only the time I let ...
2
votes
1answer
73 views

Switch off 11-minute kernel mode

If ntpd works, then the kernel copies system time to hardware clock every 11 minutes. It is shown by command adjtimex --print I want to stop the kernel eleven mode. If I run hwclock --...
1
vote
1answer
48 views

Get run time for two programs simultaneously

I am trying to make a shell script that could run tests on two differents programs simultaneously and compare their runtime in order to see which one has the best efficiency (tests have to be ...
1
vote
1answer
27 views

how to track the time taken for a move operation from one folder to another in linux

how to track the time taken for a move operation from one folder to another in linux I have been performing a move operation like the sample below. I would like to know how much time in seconds does ...
1
vote
3answers
78 views

Using time on bash functions (not commands)

How can one measure individual calls to bash functions from inside the bash file. I have a program that I call using the command eclipse -b col_solve.pl -e "myPred" This call outputs some ...
0
votes
0answers
18 views

Error when trying to run ptp4l in hybrid E2E mode

I have an Intel 9301CT 7345 that I need to set up as a PTP master. I am on Fedora 21, and have compiled the latest version of linuxPTP (ptp4l). My network setup requires the mode to be "hybrid E2E", ...
3
votes
1answer
676 views

Execution time of pi calculation in shell scripts

I have to run a couple of command lines on a shell script on Ubuntu, one of those is a pi calculation. It works fine when i run it on terminal via the following cmd line: time echo "scale=6500;4*a(1)...
9
votes
2answers
255 views

How can I conditionally pass a subshell through 'time'?

I have a setup script for a Vagrant box where I used to measure single steps with time. Now I would like to conditionally enable or disable the time measurements. For example, previously a line would ...
1
vote
1answer
49 views

Why are the timestamps on my removable media taken as UTC time?

I'm running Debian 8, and all of the files on my removable media (SD cards, USB sticks) show up with the time stamp interpreted as UTC, rather than my local time? What's going on? date gives me the ...
-1
votes
1answer
19 views

Why %H%M%S is not working in .screenrc?

According to this answer, I can rename logfile of screen with date to avoid logfile appending problem But %c used in that answer contains a colon, like 19:00. Since I have to sync files with windows, ...
2
votes
1answer
37 views

Unable to redirect stdout/stderr to log file [duplicate]

I have a script tmp.sh #!/bin/bash echo hello sleep 3 echo 3 I want to log the script running time (as well as script stdout) to a log file. user$ time ./tmp.sh >& log.tmp real 0m3....
2
votes
0answers
36 views

How to support 64-bit times on a 32-bit Linux platform

I need to support 64-bit times on a 32-bit ARM embedded Linux system based on kernel version 4.1. I use clock_gettime() and clock_settime() to get/set the time, but they are limited to 32-bit seconds ...
1
vote
1answer
46 views

linux redhat + change time from UTC to GMT+X

how to change the time from UTC to GMT+2 my current date is UTC as the following 20:23:48 root@linux-test01:~ # date Sat Apr 16 20:23:52 UTC 2016 and I want to change it from UTC to GMT+2
3
votes
3answers
68 views

Get lines between two timestamps from a file

I have this large file that I need to go through using date and time. Every line in this file has a date and time in it. I need to search through the lines and get the lines that lie between two ...
1
vote
1answer
46 views

Set ls -l time format

I would like for all my ls commands that display a date, such as ls -l, to print the date column in a format of my choosing. Currently, I manually set this every time with --time-style. Is there any ...
1
vote
1answer
53 views

System disregards Daylight Saving Time

When DST started a few weeks ago, my laptop's system time did not switch accordingly. (IOW, its time is 1-hour behind.) It is the only one of my Debian-based systems that is disregarding DST. My ...
1
vote
0answers
49 views

How to run a jar together with faketime

I need run a certain jar file with a mock time for testing purposes. When I execute the jar in the usual way $ java -jar myjar.jar it runs perfectly. But when I try to run it together with ...
0
votes
1answer
97 views

Time it takes to reboot a Linux server

Is there a way to work out how long it would take to reboot a Linux server? To clarify, the time from the reboot command starts to when the server is back up and running (ie all services started, ...
1
vote
2answers
47 views

Tracking/Monitoring Short-Lived CPU-Intensive Process on one CPU

So I've been working with this issue for some time now, and I'm having trouble finding the tools to troubleshoot this problem, which I have to imagine exist. So here's the basics of my problem: We ...
7
votes
2answers
1k views

How can I get the wall clock time of a running process?

I started a hash check of a large file and don't want to restart it using time. How can I get the wall clock time without using time at the beginning or using date right before I invoke a command?
7
votes
2answers
2k views

Memory usage command with syntax similar to the time command

What command shows the memory usage of a program, i am looking for a command that is simple to use and has similar syntax to the time command. I am trying to find the memory usage of a md5 hashing ...
3
votes
0answers
39 views

What process state(s) is counted into cpu time?

Two observations of mine (correct me if wrong): In the output of time for timing a process, 'User' and 'Sys' come from wait (2) or times (2), depending on the particular system. In Linux ...
0
votes
1answer
77 views

I want to measure the time between two jobs in a logfile

I have a logfile which name/directory is: /srv/uni/kani/LogDay.09-03-2016 The name of the logfile changes date every day. So tomorrow will be: `LogDay.10-03-2016' and so on... I would like help to ...
24
votes
1answer
6k views

Run a command for a specified time and then abort if time exceeds

I want know how I can run a command for a specified time say, one minute and if it doesn't complete execution then I should be able to stop it.
0
votes
1answer
24 views

call `time` with format option

I want to measure execution time of commands and get (to me) strange behavior of the time command. I call time like it is mentioned in the examples of the manpages with the -f or --format option and ...
0
votes
2answers
162 views

Convert unix timestamp to hh:mm:ss:SSS (where SSS is milliseconds) in AWK

How can I convert unix timestamp to hh:mm:ss:SSS (where SSS is milliseconds) in AWK. For example: echo 1456478048306 > time cat time | awk ....... > readable_time_format
30
votes
3answers
21k views

Why does Unix time start at 1970-01-01?

Why does Unix time start at 1970-01-01? Why not 1971-01-01 or any other date?
-4
votes
1answer
64 views

How to determine the CPU time of the execute of Makefile in linux or Unix? [closed]

below is my Makefile using to execute my numerical code.I would like to know the time taken by the CPU to execute these C programmes. #Makefile LDFLAGS = -DN_DIM=3 #LDFLAGS = -DN_DIM=3 -...
1
vote
0answers
46 views

On Ubuntu - /var/log/messages timestamps are 4 minutes ahead

As mentioned in the subject, timestamps in my /var/log/messages are 4 minutes ahead comparing to my desktop clock or the date command. If it was an hour, I would think this is a timezone issue, but ...
12
votes
3answers
2k views

How to average time commands?

I am timeing some of my commands. Now to average the measures, I'd like to run and time my commands a specified number of times, and get the results with a calculated mean and standard deviation. The ...
13
votes
1answer
3k views

Why would the “real” time be much higher than the “user” and “sys” times combined?

I execute and time many commands (i.e. nslookup) through SSH and I collect the total time needed for the implied service to complete (i.e. DNS). So I collect the user and sys time as the real time ...
16
votes
2answers
906 views

Is there something like `time` that also records I/O and CPU?

I can pretty quickly monitor the running time of a process with time: x@y ~ $ time foo real 0m14.299s user 0m4.770s sys 0m0.440s Is there a way I can get the same data for I/...
0
votes
0answers
63 views

Must set CMOS clock to localtime (due to DOS dual boot), timedatectl or hwclock seems to keep setting CMOS (hardware) clock to UTC!

This is beyond crazy. I have a dual-boot system, one OS is FreeDOS (which has NO ability to deal with CMOS clock being anything other than local time), and the other is Linux Mint 17. The way this ...
3
votes
3answers
373 views

How to sleep until a given date & time?

I want to write a shell where given a date (day-hour-min) e.g. 10:00 AM Sun 2:30 PM Mon ... It sleeps until that exact date & time. I thought one way of doing it is, I could get the current ...
0
votes
1answer
25 views

What service executes that sets up the real time clock

I'm looking for the service that runs that sets up the correct time on my system. Does anyone know what service does this?
3
votes
0answers
83 views

System time in Minix with best precision

I'm working on a project to modify the scheduler in MINIX 3. So to test it I need to analyse the wait time and turnaround time. To calculate the wait time I'm storing the system time when the process ...
0
votes
0answers
74 views

Incorrect file creation/modification time

So I run a backup script on a home server running Fedora 23. I also run a prune script that removes files older than 30 days. This fresh backup file keeps getting deleted because it's creation or ...
0
votes
0answers
45 views

dd process real vs. sys time

I have two quad core workstations. One is based on Intel Atom x86_64 architecture (WS1). Another one is based on armv7l architecture (WS2). Both are running 3.10 kernel version. Identical busybox dd ...
4
votes
2answers
47 views

log of open and close time of a program

I want to get the total time a program was run daily for personal logging (from start to close even if it is in the background). For example: Firefox. Is there a system log that keeps track of open ...
0
votes
2answers
87 views

Resource usage (% CPU) for given command on OS X

The time -v command outputs % CPU utilization for a given command on Linux. How do I do this on OS X? The Linux/OS X difference is illustrated here. I would like to measure multi-core utilization ...
8
votes
3answers
1k views

Measuring time within a script

This thread shows how to measure the time it takes to run a script. In my case, I am interested in measuring time between two points within a script. Here is an example of how I would like to use ...
10
votes
3answers
6k views

Why is my EC2 server's time off by ~10 seconds every day?

I have what I believe is a system file, /etc/cron.daily/ntpupdate which runs ntpdate ntp.ubuntu.com daily to sync with the network time. Every day it generates output very similar to this: /etc/cron....
0
votes
1answer
99 views

Setting time and date without using NTP

I have a "windriver" linux based Wimax ASN, and when ever I login, I find the date and time is wrong (example: "15 jul 2010"). Whenever I set both the date and time with the date command, or the ...
2
votes
1answer
92 views

Time synchronization, use NTP or just socket?

I am using a PC and a raspberry pi(both run Linux) to gather sensor data, raspberry pi gathers laser scan data, PC gathers image captured by camera. I must synchronize time for these two machines. I ...
0
votes
1answer
29 views

Using corrected time in the “attribution” variable of mutt?

I receive quite a few email messages displaying UTC time within the "Date:" header. I found the following perl script by user hyperair, very useful to display a new header "Local-Date" for incoming ...
7
votes
2answers
17k views

Good method to compare time?

I need to check for the current time and abort the script if it is not proper time of day I am supposed to run it. Also, if anyone else runs it, it should abort. For example: I need my script to only ...
1
vote
1answer
38 views

date: Getting next certain hour

I want to get a date-time string in the future, for example I always want to get the next time of 9:00 am. I know the string formats like "tomorrow" or "next day" to get a certain date-time string. ...