#pragma once

#include "stm32f4xx.h"
#include <stdint.h>

namespace time_service
{
    extern volatile uint64_t systemTime;
    
    inline uint64_t getTime(void)
    {
        return systemTime;
    }
    
    void delayms(uint64_t ms); //delay in milliseconds
    
    void delayus(uint64_t us); //delay in microseconds
    
    void Init(); //initialization
    
    void startTime(void); //start timer
    
    void stopTime(void); //stop timer
    
    uint32_t millis(); //milliseconds from start
    
    uint64_t micros(); //microseconds from start
}
