PWM output with BoneScript and C++ timer fault

Hello there,

i’m running a C++ program in eLinux on my beaglebone black

it sends outs PWM signals using analogWrite, in C++ code:

`
std::string cmdUresC=(“node -e “require(‘bonescript’).analogWrite(‘P8_13’,”+NumberToString(u1)+”, 50, console.log);"");

system(cmdUfanC.c_str());
`

I selected the pins based on the table found here: http://beagleboard.org/Support/BoneScript/analogWrite/

now the problem is when I implement a timer like specified here: http://stackoverflow.com/questions/728068/how-to-calculate-a-time-difference-in-c

it gives me wrong output: the program takes much more time to complete than the output suggests. I’m positivly sure this is due to the ‘bonescript’ command

has anyone else have this specific problem or maybe a suggestion?

Your time is much appreciated.