Re: timing functions and chunks of code in *nix?

  • From: "Littlefield, Tyler" <tyler@xxxxxxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Tue, 08 Feb 2011 09:30:11 -0700

Hello,
Thanks for this, time is useful when checking the run time of actual programs, but I need to know how long my data is taking to Serialize, so that I can figure out if it is to slow, or if there are ways of speeding it up, because when I saved from the client, it lagged the server. In this case, I actually need some sort of mechenism that will give me time with MS precision so that I can check that.

On 2/8/2011 9:25 AM, Martin Slack wrote:
Hi Ty,

Look at the time function. So time ls will give you some information about real, user and system times consumed by ls..

 Martin


----- Original Message ----- From: "Littlefield, Tyler" <tyler@xxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Tuesday, February 08, 2011 3:56 PM
Subject: timing functions and chunks of code in *nix?


Hello all,
I know windows exposes high-resolution timers to do this sorta thing, but I'm curious how I could do the same in Linux? Is there something that will give me timing in ms? so:
prev = gettime();
myfunc();
now = gettime();
printf("you spent %d ms.\n", prev-now);

--

Thanks,
Ty

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind




--

Thanks,
Ty

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: