Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

we are using red-hat enterprise Linux server 5.3, we run some testcase in red-hat how could find the start and end time of the testcases in server,please guide me.

share|improve this question

2 Answers 2

#!/bin/bash
date
./your-script-to-run-the-test-cases
date

Alternatively, if you want to just see how long it took to run, use time:

time ./your-script-to-run-the-test-cases
share|improve this answer
    
32.876u 6.018s 0:49.19 79.0% 0+0k 0+0io 0pf+0w –  user1685121 Sep 27 '12 at 8:33
    
32.876u 6.018s 0:49.19 79.0% 0+0k 0+0io 0pf+0w I got this statement which one is execution time –  user1685121 Sep 27 '12 at 8:34

If you are looking to find time that was taken for a test case you can do the following :-

(time sh -c "sh my_script_for_test_case_execution") 2>&1 | grep "real" | awk '{print $(NF)}'

This data will give you the exact time consumed for test case execution in min.sec format.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.