Coder Social home page Coder Social logo

esctabcapslock / servertimeproject Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chemical118/servertimeproject

0.0 0.0 0.0 26 KB

서버 시간을 정확하게 알아내어 보정값을 출력하자 -> python socket 모듈 사용해보기

Python 100.00%

servertimeproject's Introduction

ServerTimeProject ver 2.0

원본 readme.md

정확한 서버시간을 받아오기 위해서 제작된 python 파일이다.  
Node js와 속도 비교를 해보았지만, 생각보다 크지 않아서 python으로 제작하였다.  
해당 파일은 2단계로 실행해서, 정확한 서버시간을 얻기 위해 노력한다.
ms 단위로 결과를 출력하고, 로컬 시간에 해당 보정값을 더해야지 서버 시간이 된다는 것을 의미한다.
## Check mode
처음에 임시적인 시간의 위치를 파악하기 위해서 실행된다. 시간 지연 없이 반복해서 대략적인 시간을 예측한다.    
평균적으로 ± 25ms 정도의 정확도를 가진다.
## Accurate mode
임시적인 시간을 파악하면 그 주변 시간으로 이동해 서버의 차단을 방지한다. 거의 1초 간격으로 실행되서 범위를 줄이기 위해 최선을 다한다. ± 7 ~ 11ms의 오차를 가진다.

## Upadate log

### v1.0
* 기초적인 코드 작성, 파일 입출력을 통한 로그 분석 기능
### v1.1
* 차이가 1초 이상일 때 발생하는 오류 수정
### v2.0
- 알고리즘를 크게 수정했습니다
  * 정확도가 특정한 상황에서 떨어지는 경우를 개선했습니다
  * 항상 같은 횟수 동안 작동합니다, 운에 기인하는 요소를 제거했습니다
  * 정확도가 평균적으로 3ms 향상되었습니다
- 로그 기능을 강화했습니다
  * 실행하는 경우에 변곡점보다 빠르고, 늦고, 중간인 경우 3가지를 나눠서 각각의 경우의 수를 출력합니다 (사용자는 이를 통해 정확도를 가늠할 수 있습니다)
  * txt로 출력하는 log를 ms 단위로 출력하도록 바꾸었습니다

내가 추가한 내용.

  • sk.py를 추가하였다. urllib.request에서 302 헤더 등을 보다 깔끔하게 처리할 겸 소캣 공부를 하기 위해 socket 모듈로 갈아치웠다.
  • 대충 윈도우 curl함수랑 비슷하게 했음.
  • 안먹히는 사이트 발견.... -> https로 가야하나???
  • Rust 재작성 + GUI 추가

servertimeproject's People

Contributors

chemical118 avatar esctabcapslock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.