You have
    cout << "Your elapsed time is " << elapsedtime <<endl;
Did you mean
    cout << "Your elapsed time is " << elapsedtime(time1, time2) <<endl;
Update
For some reason,
    cout << "Your elapsed time is " << elapsedtime <<endl;
does not produce a compiler error under g++ 4.7.3 even though the intent is to use elapsedtime(time1, time2). 
I was able to successfully compile and build:
#include <iostream>
using namespace std;
int elapsedtime(int time1, int time2)
{
   return 0;
}
int main()
{
   cout << "Your elapsed time is " << elapsedtime <<endl;
}
Perhaps another SO post is needed to answer the question, “How does g++ not report error with the above code?”.
7
solved why is elapsedtime giving me an output of 1? [closed]