New to this mailing list so this is my first response.

Why not just take (24*60)/[number of unsent messages] and send them on
that interval?

You probably dont want messages appearing in the dead of night, so you
can safely assume the last 2 hours and first 6 are off limits by doing
((16*60)/[number of unsent messages])+(6*60).

Your client probably wont get up at 6am just to send off 25 messages,
so another addition would be to get the current time and modify the
above formula to reflect the current time.  This would work if they
came back to add a few more later messages after lunch, assuming
something is keeping track of which ones were sent and unsent.
(((22-[current hour])*60)/[number of unsent messages])+(([current
hour]-1)*60+[current minute]).

Again no randomness is needed because its likely the client wont send
them at the exact time every day with the exact same number.

Thats probably the most I can help you with it, post some code if you
want more help.

On 2/9/11, Mike Blezien <mick...@frontiernet.net> wrote:
> What they have right now are about 25 messages they wish to spread out
> through out a 24hr period so they are sent out randomly during this 24
> period, not a pre determined every X minutes or X hours. Why .... I'm not
> really sure, but that's what they want to do. I think I have it figured out
> though.
>
> thx's
>
> Mike(mickalo)Blezien
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Thunder Rain Internet Publishing
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>   ----- Original Message -----
>   From: Uri Guttman
>   To: Mike Blezien
>   Cc: Perl List ; Mike McClain
>   Sent: Wednesday, February 09, 2011 5:06 AM
>   Subject: Re: Randomizing a 24hr time period
>
>
>   >>>>> "MB" == Mike Blezien <mick...@frontiernet.net> writes:
>
>     MB> Uri,
>
>     MB> yes that does make sense but that's what the customer wants :)
>     MB> There always right aren't they !!
>
>   then do something very simple. send a message every N minutes where N is
>   randomly picked from say 5-10. they will never know it wasn't a more
>   random distribution.
>
>   uri
>
>   --
>   Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com
> --
>   -----  Perl Code Review , Architecture, Development, Training, Support
> ------
>   ---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com
> ---------
>


-- 
Skirv

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to