Why not use a js ntp library?
http://jehiah.cz/a/ntp-for-javascript
Then have a dedicated ntpd daemon running. That will be way more extensible, maintainable, and scalability than a custom C program.
http://jehiah.cz/a/ntp-for-javascript
Then have a dedicated ntpd daemon running. That will be way more extensible, maintainable, and scalability than a custom C program.