Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Execution Time variations

Dhanraj_C_
Beginner
274 Views

Hello,

I am a naive user. Recently I have been studying regarding Threading Building Blocks. I tried executing the Fibonacci program and the results were obtained in milliseconds. When I execute the same program in Java using multithreading, I got the result in nano seconds. Can anyone tell me the reason behind such a huge variation?

Thanks,

Dhanraj 

 

0 Kudos
1 Reply
MLema2
New Contributor I
274 Views

What timer are you using ?
Under Windows, clock() timer precision is about 10ms.  
Y
ou should try using QueryPerformanceCounter instead.

Beware of STL implementation too.. 
Under VS2012, they have this 
typedef system_clock high_resolution_clock;


 

0 Kudos
Reply