timing functions and chunks of code in *nix?

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

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

Other related posts: