#include <iostream>
#include <conio.h>
#include <Windows.h>
using namespace std;

int drying_revolution(int dryingspin_revolution);
int rinsing_revolution(int rinsingspin_revolution);

int main()
{
  enter:
    cout << "...CHOOSE YOUR DESIRE WASHING MODE...\n";
    cout << "ENTER 'a' for cotton mode\n";
    cout << "ENTER 'b' for Quick wash\n";

    int temperature_sensor = 0;     //reading from the temperature sensor console in degree celsius

    int rinsingspin_revolution = 0;
    int dryingspin_revolution = 0;  // read revolution from the motor spin console
    char washtype;                  //gotten from user via the buttons on the machine control

    char cotton = 'a';
    char quickwash = 'b';

    cin >> washtype;
    system("cls");
    if (washtype == cotton)         //link cotton as the washtype selected by the user on the machine through console
    {
        temperature_sensor = 80;
        // a signal is send through the console to the heater to heat 
        // the water till the temperature sensor sense up to 80 deg celcius
        cout << "................water heating in progress.......\n";
        cout << "ready for cotton";
        cout << "............washing in progress.......";
    }
    if (washtype == quickwash)      // links quick wash as the washtype selected by the user on the machine through the console
    {
        temperature_sensor = 40;
        //a signal is send through the console to heat 
        // the heater to continue heating till the temperature sensor sense up to 40 deg celcius
        cout << "ready for quick wash";
    } else {
        cout << "invalid selection";
        system("cls");
    }

    int rinsing_revolution(int rinsingspin_revolution); // set the rinse spin at 1000 revolution
    {
        return 1000;
    }
    int drying_revolution(int dryingspin_revolution); //set the dry rinse at 1000revolution
    {
        return 1000;
        cout << "drying in progress......\n";
    }

    system("pause");
}

So, your question is... what?

my question is i need code to delay the runtime of the above code

Hello, you could try inserting this code:

for (unsigned int i = 0; i < 40; ++i) // change i < 40 for your needs
{
    functioncall();
    sleep(1); // wait 1 second 
}

Vincentas

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.