Bash time and programming


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash time and programming
# 1  
Old 06-25-2009
CPU & Memory Bash time and programming

I have inherited a C++ program which does not manage it's memory at all. It has a whole bunch of 'new' variables without many deletes. I believe it was the programmers intent to let the OS clean up.

Correct me if I am wrong, but I believe the unix/linux systems clean up after the program finishes running.

What I need to do is print out the time which the program executes, and if possible, I would like to record the clean up time. I would like to do this in a bash script, however, how do I go about this?

The program uses Wang's algorithm as a tree search to put together rectangles into a larger rectangles until it's exhaustive search finds the optimal. So as you can imagine, it can run for a very long time.

Thanks!
# 2  
Old 06-25-2009
There is no way to differentiate "cleanup time"

try running your compiled code like this
Code:
time myprogram arg1 arg2

And yes, once a process ends the programs allocated memory is reclaimed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Read() time out in socket programming

Hi, When can the read() system call gives timeout error when the same connection worked for writing data to the other end of the socket, while the next call with read() gives timeout error? Can anyone please explain when this kind of situation appears? Thanks, Sanzee (2 Replies)
Discussion started by: sanzee007
2 Replies

2. Linux

Bash Programming. Could anyone help me?

Hi! I'm new in bash programming and I need to make an script that reads a txt file line by line (every line is like "Name;FirstLastName;SecondLastName;Sex") and has to give every student 3 random marks, its average and add a counter if they are male/female and if they passed. I've been trying with... (4 Replies)
Discussion started by: HeartHacker
4 Replies

3. Shell Programming and Scripting

ctrl-c in bash script - Programming

Hi All, I need to place a ctrl-c interrupt in a bash script, there is no other way, it has to be done :) can someone please advise how would I go about this? i want to use ctrl c in below code, after the code excution of just 1 min or 1sec java Cspsamp 111.19.5.172 7025 rd1... (6 Replies)
Discussion started by: aish11
6 Replies

4. Homework & Coursework Questions

Bash Shell Programming assignment.

Please take a look I am stuck on step 4 1. The problem statement, all variables and given/known data: #!/bin/bash ### ULI101 - ASSIGNMENT #2 (PART A) - DUE DATE Wed, Aug 3, 2011, before 12 midnight. ###==================================================================================== ###... (13 Replies)
Discussion started by: almirzaee
13 Replies

5. Shell Programming and Scripting

Bash programming help

Hello all; I have little knowledge of bash programming, and I was wondering if you could help me out. I would like to create a bash script, as detailed below. process.sh is the bash script itself list.dl is a text file. In this text file, the first line is the directory from... (1 Reply)
Discussion started by: tehalexf
1 Replies

6. Shell Programming and Scripting

bash programming

how do you allow a user to input a particular group name as an argument?? thnx for your time. (2 Replies)
Discussion started by: bumdeal2
2 Replies

7. Shell Programming and Scripting

Bash Programming

Write a Shell script to analyse the disk usage of students in a particular class. The program should allow the user running the script to input the particular class name (group name) as an argument to the script. The script should create a file called “logfile” in the home directory of the user... (2 Replies)
Discussion started by: bumdeal2
2 Replies

8. Shell Programming and Scripting

help bash programming

how to i grep a keyword which ignore upper case or lower case. for an example : user enter CoUcH and the grep also can grep couch which in text.txt although upper or loever case is different .. how to do that ? any idea? (1 Reply)
Discussion started by: CheeSen
1 Replies

9. Shell Programming and Scripting

Programming in ksh and not in bash

Hi all.... I was wondering if there is a lot of differences between /bash and ksh programming. Im learning about bash programming, but all what I had read in this forum, points me to learn more about ksh over bash. Is that right and why? Unfortunately, I can’t write ksh progs on my work,... (2 Replies)
Discussion started by: TARFU
2 Replies

10. UNIX for Advanced & Expert Users

multiplex programming in real-time OS.

Hi, As far as I known, kqueue/kevent model can be used to improve the efficiency of systems event dispatching. I m wondering whether kqueue/kevent is same as the real-time OS event model. I also want to know when writing multiplexing app in real-time OS, what APIs need to be used for... (0 Replies)
Discussion started by: bsderss
0 Replies
Login or Register to Ask a Question