#include <stdio.h>
#include <stdlib.h>
#if defined WIN32
#include <windows.h>
#elif defined linux
#include <time.h>
#else
#error "UNSUPPORTED PLATFORM"
#endif

void usage()
{
	printf("Usage: sleep MILISECONDS\n");
	printf("where MILISECONDS is time to sleep in miliseconds\n");
}


int main(int argc, char*argv[])
{
	if (argc==1){
		usage();
		return 1;
	}
#ifdef WIN32
	DWORD timeToSleep;
	timeToSleep = atoi(argv[1]);
	Sleep(timeToSleep);
#else //linux
	struct timespec t;
	t.tv_sec=0;
	t.tv_nsec=atoi(argv[1])*1000;
	nanosleep(&t, 0);
#endif
	return 0;
}
