AnsweredAssumed Answered

AFTimeSpan create equal divisions

Question asked by mdspath on Jul 10, 2015
Latest reply on Jul 10, 2015 by mdspath

Hello:

I'm trying to allow the user of our custom app (built using the AF SDK) to subdivide the timeframe into equal chunks. I know it has to be converted to ticks, how to get a new AFTimeSpan from a Tick value? IN the code below I'm using 10 as my divisor.

 

          // Set the Time Range

            AFTimeRange myTimeRange = new AFTimeRange();

            myTimeRange.StartTime = new AFTime(gbRealStart);

            myTimeRange.EndTime = new AFTime(gbRealEnd);

 

 

            // find the span to use based on how many chunks of data

            //AFTimeSpan span = AFTimeSpan.Parse("5s");

            AFTimeSpan span = new AFTimeSpan(myTimeRange.Span);

 

 

            // we will call the interpolated values method just to show user the number of data points

            // now divide the AFTimeSpan into egual parts

            long NumTicks = span.Ticks / 10;

 

Thanks

Outcomes