You are not logged in.

#1 2013-02-27 22:06:57

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Best method for timestamping? (for later use with perl script)

What is the best method that I can use to timestamp events in Linux for later use with perl script?

I am performing some energy measurements.. where I am running several tasks separated by 20 secs in between. Before I start any execution of tasks, I always place initial delay for me to start the script and start the measurement device.

My problem is that I don't know how long is that first delay exactly. So to solve this, I thought I could use date commands to time stamp all tasks.. or at least to timestamp first dela.

Here is example of what I am doing:
1st delay
task 1
20s
task 2
20s
task 3..... etc

What would be the best to use?

Offline

#2 2013-02-27 22:55:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: Best method for timestamping? (for later use with perl script)

logger.

It posts messages straight to the system log.  You can see the message, in all its glory using tools like journalctl.  You will see the message, the date, time, host name, user name, and the PID of logger when it ran.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB