From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 1 Aug 2011 08:36:22 -0400 To: 9fans@9fans.net Message-ID: <2f1c96759475c0a5e3b8a59eec02d2dc@brasstown.quanstro.net> In-Reply-To: <9ede6397cd5d6431cfc44a2504cdae6f@swcp.com> References: <9ede6397cd5d6431cfc44a2504cdae6f@swcp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] nsec limits? Topicbox-Message-UUID: 09769f42-ead7-11e9-9d60-3106f5b1d025 On Mon Aug 1 08:19:23 EDT 2011, ebo@sandien.com wrote: > I am setting up some timing tests and am currently dumping the > timestamps using nsec(). When I post-process the data I find that the > it is wrapping around, but I have not found anything that clearly states > when it does that. From the code I am guessing that is on the second > boundary. Is that correct? if nsec(2) is wrapping around then time(2) will also wrap around. i have not seen nsec do anything like that. it sounds to me like you may be having integer truncation problems. are you using a (u)vlong variable to store the results of nsec? - erik --- ; cat > nsec.c #include #include void main(void) { print("%llud\n", nsec()); sleep(10000); print("%llud\n", nsec()); } ; tmk nsec.c 8c -FVTw nsec.c 8l -o 8.nsec nsec.8 ; 8.nsec 1312201920700241540 1312201930703219588 ; hoc (1312201930703219588 - 1312201920700241540)/1e9 10.002978048