Re: Finer than a second.

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 38771
interpreted = N
texte = Samuel Renkert wrote: > > How can I determine time with finer gradations than a second? > > I am trying to easily sequence visitors to a website. Something > along the lines that I can > [search ...VisitedTimesort=1...] to see who visited first and so on. > I really need to *know* the order, it's not good enough to say these > 3 visited within the same second. I figure if I can measure time > with a fine enough gradation, I can cut down the collisions.This is likely to be very difficult to manage. Some O/S's are not as forthcoming with this kind of information as others. You haven't explained why you need to know the exact order of visitors; I think you should rethink your scheme, however. If three people click a link and precisely the same time, there are literally thousands of reasons why one would arrive at your site first: Speed of their computer Speed of their DNS cache Speed of their internet connection How many hops they are away from one of the backbones The vagaries of the dozen routers between them and you etc...I think your model is suspect if you are going to rely on subsecond variations.> > I have a suspicion that [cart] would work fine as well. I would lose > the time they visited, but that's ok, the order is what is important > and I can save the time in another field. Are successive [cart] > values always increasing (with [cart] treated as a number, as I know > I should not do. :) )?Don't ever treat [cart] as a number. It is not just a bad idea, it will not work for you. [cart] is too long to be reliably represented as an integer on most O/S's, so it gets converted to a float and you WILL lose precision.That said, [cart]'s of the same length are sortable as ASCII and I believe that [cart]'s should be monotonically increasing (even when considering varying length) when compared as ASCII. However, only Grant or one of the current programmers would know for sure.> > I know I could do it with a small database that just increments a > number for each page load. But I would like the solution to be as > self contained as possible.This will introduce race conditions unless you use locking. This is exactly what [cart] was invented to deal with.HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Finer than a second. (John Peacock 2001)
  2. Re: Finer than a second. (Samuel Renkert 2001)
  3. Re: Finer than a second. (John Peacock 2001)
  4. Finer than a second. (Samuel Renkert 2001)
Samuel Renkert wrote: > > How can I determine time with finer gradations than a second? > > I am trying to easily sequence visitors to a website. Something > along the lines that I can > [search ...VisitedTimesort=1...] to see who visited first and so on. > I really need to *know* the order, it's not good enough to say these > 3 visited within the same second. I figure if I can measure time > with a fine enough gradation, I can cut down the collisions.This is likely to be very difficult to manage. Some O/S's are not as forthcoming with this kind of information as others. You haven't explained why you need to know the exact order of visitors; I think you should rethink your scheme, however. If three people click a link and precisely the same time, there are literally thousands of reasons why one would arrive at your site first: Speed of their computer Speed of their DNS cache Speed of their internet connection How many hops they are away from one of the backbones The vagaries of the dozen routers between them and you etc...I think your model is suspect if you are going to rely on subsecond variations.> > I have a suspicion that [cart] would work fine as well. I would lose > the time they visited, but that's ok, the order is what is important > and I can save the time in another field. Are successive [cart] > values always increasing (with [cart] treated as a number, as I know > I should not do. :) )?Don't ever treat [cart] as a number. It is not just a bad idea, it will not work for you. [cart] is too long to be reliably represented as an integer on most O/S's, so it gets converted to a float and you WILL lose precision.That said, [cart]'s of the same length are sortable as ASCII and I believe that [cart]'s should be monotonically increasing (even when considering varying length) when compared as ASCII. However, only Grant or one of the current programmers would know for sure.> > I know I could do it with a small database that just increments a > number for each page load. But I would like the solution to be as > self contained as possible.This will introduce race conditions unless you use locking. This is exactly what [cart] was invented to deal with.HTHJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5747------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ John Peacock

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Lookup Notfound (1998) Creating PDF (2004) Server Freeze (1998) WebCatalog can't find database (1997) How to redirect based on price subtotal? (1998) carriage returns in data (1997) Problems passing [SKU] with $Replace in 2.0 (1997) Templates on Unix & CGI on Mac? (1997) WebDNA Book? (2003) Macauth: Dates and No Scripting... (1997) New public beta available (1997) Country & Ship-to address & other fields ? (1997) Field name-subcategory (1997) Problems with SELECT MULTIPLE (1999) WebCat2b12 - nesting [tags] (1997) Encrypting WebDNA Templates (1999) WebMerchant 1.6 and SHTML (1997) Disappearing Database (1998) [WebDNA] Talklist Archive & Twitter (2009) WC2b15 File Corruption (1997)