strictfp pastebin

Paste #80629, submitted October 3, 2017, 4:23 am
Paste Again | Create new paste

public void getData(View view) {
        String url = "http://10.23.2.54/Blog/api/Person/Get";

        HttpURLConnection connection;

        try {
            long startTime = System.currentTimeMillis();

            connection = (HttpURLConnection) new URL(url).openConnection();

            int responseCode = connection.getResponseCode();

            if (responseCode == HttpURLConnection.HTTP_OK) {

                Person[] persons = new Gson().fromJson(getStringFromInputStream(connection.getInputStream()), Person[].class);

                long endTime = System.currentTimeMillis();

                double difference = endTime - startTime; //miliseconds

                Log.e("Difference: ", new Double(difference).toString());
            }

        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }