> I need to now how many times a second I am sampling an accelerometer
It seems to me you don't know how often you're sampling it. I guess you are probably reading it in a simple loop, with or without a delay.. Yes, you were dumping data into a UART without even waiting for it to finish sending:
https://community.freescale.com/thread/304594
Rather than writing code with uncontrolled timing and then trying to measure it, you're way better off writing code with controlled timing. The simplest way is to start a timer (doesn't matter which one) that runs at 100Hz, or 1kHz, or whatever is a suitable "execution heartbeat" for your application. Then have your main loop wait for your timer to trigger, and then run through whatever your program does (like sampling the ADC) *ONCE*. Then you know it runs 100 or 1000 or 10,000 times per second. You can even have the timer interrupt run (or start) ALL of your code with the mainline in a "STOP" instruction. That reduces power consumption (if that matters). Or use the timer interrupt to kick the mainline out of the "STOP" and then run the application code once, and then back to the "STOP".
> I need to now how many times
The simpler answer is to use an Operating System. It should come with 95% of the stuff you're otherwise going to have to write from scratch. And given your example code above, that could take a while.
Use it to schedule your tasks, send your data and to measure time for you. Can you use MQX on your project? How about uTasker?
http://www.utasker.com/
Tom