Skip to content

Commit

Permalink
🚀 性能优化,新增 TCP 支持
Browse files Browse the repository at this point in the history
  • Loading branch information
lalakii committed Nov 6, 2024
1 parent 1c15461 commit dc4ec69
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 159 deletions.
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@

## 它是一个简单的时钟同步小工具,目前适用于 Windows 操作系统

因为 Windows 默认的时间同步似乎有点缓慢,所以我制作了它。
因为 Windows 默认的时间同步似乎有点缓慢,所以我制作了它,
它现在支持通过 TCP 协议,从 HTTP(s) 协议的网站上获取时间。

## 下载地址

- [本地下载](https://github.com/lalakii/WINtp/releases)
- [蓝奏云 1](https://a01.lanzoui.com/iHXP02ecxgwf)
- [蓝奏云 2](https://a01.lanzout.com/iHXP02ecxgwf)
- [蓝奏云 3](https://a01.lanzouv.com/iHXP02ecxgwf)
- [蓝奏云 1](https://a01.lanzoui.com/iqtKI2ef4bkh)
- [蓝奏云 2](https://a01.lanzout.com/iqtKI2ef4bkh)
- [蓝奏云 3](https://a01.lanzouv.com/iqtKI2ef4bkh)

### 如何使用它?

Expand All @@ -31,37 +32,39 @@
### 配置文件示例

```conf
# 一个简单的时间同步小工具WINtp
# 一个简单的时间同步小工具 WINtp
#
# 此配置文件不是必须的,如果你不需要配置,可以将其清空,只需要保留时间同步 AutoSyncTime = true
# 此配置文件是必须的,用于存储程序运行所需的配置参数
#
# 默认内置了"time.asia.apple.com", "time.windows.com", "rhel.pool.ntp.org",这3个ntp服务器地址
# 如果你需要恢复默认值,直接删除它,程序启动后会自动生成一份新的
#
# 如果你想要自定义ntp服务器,可以直接写在这个文件里面,每行一个
#
# 可以先用ping测试ntp服务器的延迟怎么样噢
# 如果你想要自定义ntp服务器,按照规律添加即可。
Ntps = time.asia.apple.com;ntp.tencent.com;ntp.aliyun.com;rhel.pool.ntp.org;
cn.pool.ntp.org
asia.pool.ntp.org
cn.ntp.org.cn
ntp.aliyun.com
time.apple.com
time.cloudflare.com
centos.pool.ntp.org
# 【自动同步系统时间】开关,如果被注释了,或是值为 false 将不会同步系统时间(防止杀软误报添加这个配置项)
AutoSyncTime = true
# 自动同步系统时间开关,如果取消注释将不会同步时间(防止杀软误报添加了这个配置项)
# 如果因为某些原因,无法访问 UDP 端口。
# 这时你可以取消下面的注释,程序将通过 TCP 协议,从指定的网站上获取时间 ~
# 这个选项不会与 Ntps = 冲突,它们可以同时存在,也可以二选一。
# 可以访问 UDP 端口时,通常不要启用它。
#
AutoSyncTime = true
# Urls = www.baidu.com;www.qq.com;www.google.com;
#
# 默认从 80 端口获取数据,如需使用 443,取消下面的注释
#
# UseSSL = true
#
# 如果【不想使用我内置的ntp地址】,取消注释掉下面的行
# 如果【需要打印详细信息】,取消下面的注释
#
# useDefaultNtpServer = false
# Verbose = true
#
# 如果【需要打印详细信息】,取消注释下面的行
# 如果【需要自定义超时】,修改下面的参数,单位是毫秒。默认30秒无法获取时间即超时,程序退出。
# 网络较差时可将数值调大一些
#
# verbose = true
# Timeout = 30000
#
####################
# by lalaki.cn ##
Expand Down
62 changes: 32 additions & 30 deletions README_en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WINtp — NTP time synchronization client, a faster implementation of time synchronization.
# WINtp — NTP time synchronization client, providing a faster implementation for time synchronization.

[![Latest Version](https://img.shields.io/github/v/release/lalakii/WINtp?logo=github)](https://github.com/lalakii/WINtp/releases)
[![License: Apache-2.0 (shields.io)](https://img.shields.io/badge/License-Apache--2.0-c02041?logo=apache)](LICENSE)
Expand All @@ -9,59 +9,61 @@

[ [中文](README.md) | [English](README_en.md) ]

## It is a simple clock synchronization tool, currently suitable for Windows operating system.
## It is a simple clock synchronization tool, currently suitable for Windows operating systems

Because the default time synchronization in Windows seems a bit slow, I created it.
Because the default time synchronization in Windows seems a bit slow, I created this tool. It now supports retrieving time from websites using the TCP protocol over HTTP(s).

## Download
## Downloads

- [Github](https://github.com/lalakii/WINtp/releases)
- [Lanzou 1](https://a01.lanzoui.com/iHXP02ecxgwf)
- [Lanzou 2](https://a01.lanzout.com/iHXP02ecxgwf)
- [Lanzou 3](https://a01.lanzouv.com/iHXP02ecxgwf)
- [Lanzou 1](https://a01.lanzoui.com/iqtKI2ef4bkh)
- [Lanzou 2](https://a01.lanzout.com/iqtKI2ef4bkh)
- [Lanzou 3](https://a01.lanzouv.com/iqtKI2ef4bkh)

### How to use it?

Typically, you just need to double-click to run it. The software has no UI interface; it will automatically synchronize the system time upon startup.
Typically, you just need to double-click to run it. The software has no UI interface; it will automatically synchronize the system time after starting.

After completion, it exits immediately and runs no background processes.
Once completed, it exits immediately and runs no background processes.

It is recommended to install it as a system service, or you can set it to start at boot according to your preference.
It is recommended to install it as a system service, but you can also set it as a startup item according to your preference.

### Configuration File Example
### Configuration

```conf
# A Simple NTP Client【WINtp
# A simple time synchronization tool WINtp
#
# This configuration file is not mandatory. If you do not need configuration, you can clear it, just keep the time synchronization setting: AutoSyncTime = true.
# This configuration file is required to store the configuration parameters needed for the program to run
#
# By default, the built-in NTP server addresses are "time.asia.apple.com", "time.windows.com", and "rhel.pool.ntp.org".
# If you need to restore the default values, simply delete this file, and a new one will be automatically generated when the program starts
#
# If you want to customize the NTP servers, you can write them directly in this file, one per line.
#
# You can first use ping to test the latency of the NTP servers.
# If you want to customize the NTP server, just add it according to the format.
Ntps = time.asia.apple.com;ntp.tencent.com;ntp.aliyun.com;rhel.pool.ntp.org;
cn.pool.ntp.org
asia.pool.ntp.org
cn.ntp.org.cn
ntp.aliyun.com
time.apple.com
time.cloudflare.com
centos.pool.ntp.org
# The [Automatic System Time Synchronization] switch. If it is commented out or set to false, the system time will not be synchronized (this configuration item is added to prevent false positives from antivirus software).
AutoSyncTime = true
# Automatic system time synchronization switch. If uncommented, time synchronization will not occur (this configuration item was added to prevent false positives from antivirus software).
# If, for some reason, you are unable to access the UDP port.
# At this point, you can uncomment the line below, and the program will retrieve the time from the specified website using the TCP protocol.
# This option will not conflict with "Ntps =", they can coexist or be used as alternatives.
# When the UDP port is accessible, it is generally not recommended to enable this option.
#
AutoSyncTime = true
# Urls = www.baidu.com;www.qq.com;www.google.com;
#
# By default, data is retrieved from port 80. To use port 443, uncomment the line below.
#
# UseSSL = true
#
# If you do not want to use my built-in NTP address, uncomment the line below.
# If [Detailed Information Printing] is needed, uncomment the line below.
#
# useDefaultNtpServer = false
# Verbose = true
#
# If you need to print detailed information, uncomment the line below.
# If [Custom Timeout] is needed, modify the parameter below. The unit is milliseconds. By default, if the time cannot be retrieved within 30 seconds, the program will time out and exit.
# You can increase the value when the network is poor.
#
# verbose = true
# Timeout = 30000
#
####################
# by lalaki.cn ##
Expand Down
Loading

0 comments on commit dc4ec69

Please sign in to comment.