title: GetNetworkUsageAsync() in windows Phone 8.1 (C#)
body: <p>I want to use GetNetworkUsageAsync to get bytes send and receive.<br>
  When I do like this, GetNetworkUsageAsyncHandler called But not immediately.<br>
  I want to use BytesSent and BytesReceived immediately.<br>
  What can I do?  </p>
  
  <pre><code>private void MakeDataUsageChart()
      {
          //Make days of Month
          GregorianDates = MakeMonthGregorianDate(YearGregorian, MonthGregorian);
  
          localTime = new DateTime(2015, 9, 2, 0, 0, 0);
          StartTime = new DateTimeOffset(localTime, TimeZoneInfo.Local.GetUtcOffset(localTime));
          localTime = new DateTime(2015, 9, 3, 0, 0, 0);
          EndTime = new DateTimeOffset(localTime, TimeZoneInfo.Local.GetUtcOffset(localTime));
          InternetConnectionProfile.GetNetworkUsageAsync(StartTime, EndTime, DataUsageGranularity.Total, new NetworkUsageStates()).Completed = GetNetworkUsageAsyncHandler;
  
          for (int count = 0 ; count &lt;= GregorianDates.Count -1 ; count++)
          {
              ChartDatasGregorian.Add(new Data()
              {
                  CategoryDownload = GregorianDates[count],
                  ValueDownload = BytesReceived,
                  CategoryUpload = GregorianDates[count],
                  ValueUpload = BytesSent,
                  CategoryTotal = GregorianDates[count],
                  ValueTotal = BytesReceived + BytesSent
              });
          }
          this.DataUsageLineSeries.DataContext = ChartDatasGregorian;
      }
      private void GetNetworkUsageAsyncHandler(IAsyncOperation&lt;IReadOnlyList&lt;NetworkUsage&gt;&gt; asyncInfo, AsyncStatus asyncStatus)
      {
          if (asyncStatus == AsyncStatus.Completed)
          {
              IReadOnlyList&lt;NetworkUsage&gt; networkUsages = asyncInfo.GetResults();
  
              foreach (NetworkUsage networkUsage in networkUsages)
              {
                  string BytesSents = networkUsage.BytesSent.ToString();
                  string BytesReceiveds = networkUsage.BytesReceived.ToString();
                  BytesSent = Convert.ToInt64(BytesSents);
                  BytesReceived = Convert.ToInt64(BytesReceiveds);
  
                  //Column2DataPlan.Text = BytesSents + "   " + BytesReceiveds;
              }
  
          }
      }
  </code></pre>
  
  <p>I'm sorry for bad English.<br>
  Thanks.</p>