Meeting.py
Revision as of 17:12, 19 July 2009 by PeterHarding (talk | contribs)
Source
Script to generate randomized meeting times for data input to a LoadRunner script.
#!/usr/bin/env python # # $Id:$ # #--------------------------------------------------------------------- import sys from random import randint #--------------------------------------------------------------------- def event(): duration = randint(1,30) s_duration = '%02d:%02d' % (duration / 60, duration % 60) t_start = randint(0,204) * 5 s_start = '%02d:%02d' % (t_start / 60, t_start % 60) t_end = t_start + duration s_end = '%02d:%02d' % (t_end / 60, t_end % 60) return '%s,%s,%s' % (s_start, s_end, s_duration) #--------------------------------------------------------------------- def main(): print "StartTime,EndTime,Duration" for i in range(500): print event() #--------------------------------------------------------------------- main() #---------------------------------------------------------------------