I have implemented a method to send data to a server but I want to delay the implemented functions failure message around 20 milliseconds ,
my code is
public void onFailure(Call call, IOException e) {
              
                call.cancel();
                Log.d("FAIL", e.getMessage());
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        TextView responseText = findViewById(R.id.responseText);
                        responseText.setText("Failed to Connect to Server. Please Try Again.");
                    }
                });
            }
 
    