Re: function for clockticks since 1980?



On Jul 29, 2:58 am, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:

#include <time.h>
time_t time(time_t *timer);

The time function determines the current calendar time. The
encoding of the value is unspecified.

so you can't rely on much variability there (it *may* be fine, but the
solution would not be portable).

Yeah, this one seems to be down to the second only, and so when the
app is run 100 times (or even just 2 times) within the same second,
then I got a prob =:-)

Since there is not ideal portable solution, your best bet may well be
to accept that go fully platform dependent. A small 'get_random_seed'
function will be a couple of lines long and can be written easily for
(reasonable) platform on which a web application might run. Post in a
newsgroup for your which every platform you are currently using for
ideas about getting a good random seed.

--
Ben.

I might try the /dev/random for linux platform as was suggested by Xu
earlier. Just worried about the overhead on that one though. App is
only planned to run on linux on i32 or platform, so I only need it to
work on this (for now..). Im pretty sure there is an interrupt to give
this amount of milliseconds since 1980 on that cpu, but then again I'd
hate to stick in cpu specific stuff..
Somehow I thought this function would be standard in C (I'm not so
used to C)... oh well :-)
Thanks.

Tobias

.



Relevant Pages

  • Re: private Deploy of SQL CE 3.1
    ... dependencies for device platform. ... data provider" catalog items in my platform builder, ... dll sqlceme30.dll was sitting right there in the app directory. ... device uses 3.1 dlls. ...
    (microsoft.public.sqlserver.ce)
  • Re: The Common System Interface: Intels Future Interconnect
    ... Server HW - 10-15% ... You say "relative importance to Cust's" of the App is ... Platform security, support, reliability, performance and all other OS/ ... keep in mind that there is now a massive trend to consolidating both servers and ...
    (comp.os.vms)
  • Re: backward compatibility in Vista
    ... Key here is that there are Vista-only APIs, ... to develop on NT 4 if the app had to run on NT 4. ... develop on XP and test on Server 2003 and Vista, ... so I'll develop and test on the desired platform. ...
    (microsoft.public.vc.mfc)
  • Re: 64 bit OS
    ... configuration for platform "Any CPU", how does run this application on 64 bit ... Any CPU apps will run as 64 bit. ... If your app attempts to load a 32 bit native assembly at any point you'll crash the app. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Has independent Palm deveopment died?
    ... "shareware" software for java, symbian, MW? ... Many of the freeware/shareware download sites give download numbers for ... app from a different platform) the first thing to do would be to see ...
    (comp.sys.palmtops)