okay I asked this question once in Newbie section but I kinda think it didn't belong there so I'm posting it here with a little bit more explanation

I'm working on a project for school involving sorting algorithms and i need to know if there is a command in linux to record "wall time" or to access the CPU and tell me the clock cycles.
I did find the command time but I'm not sure if that's what I need. TIA

I got a reply recommending cpustat but I don't think that will work.

Record the "Wall Time" for each run by calling the system clock when your algorithm starts and again when your algorithm finished and computing the difference.

is taken directly from my project description. I am pretty much just implementing four sorting algorithms and writing a report on the differences. I guess that I don't necessarily need a linux command, I need a function/command/whatever that will work in C/C++ that accesses the system clock. Sorry for any confusion on my part. TIA