#include <Servo.h>
Servo myServo;
int ang = 0;

void printData()
{
  float t = 2*(ang/180.0)+0.5;
  Serial.print("Angle is:");
  Serial.print(ang);
  Serial.print(",Time is:");
  Serial.println(t);
}

void setup()
{
  Serial.begin(9600);
  myServo.attach(10);
}
 void loop()
 {
  for (ang = 0; ang<= 180; ang+=30)
 {
 myServo.write(ang);
 printData();
 delay(500);
 }
 for (ang = 180; ang>= 0; ang -= 30)
 {
  myServo.write(ang);
  printData();
  delay(500);
 }
 }